Skip to content

Commit 94d78c4

Browse files
committed
migrates from tslint to eslint
Signed-off-by: Andrey Kononykhin <[email protected]>
1 parent c1fa414 commit 94d78c4

File tree

6 files changed

+359
-0
lines changed

6 files changed

+359
-0
lines changed

Diff for: wasm/demo/.eslintrc.js

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/*
2+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
3+
https://github.com/typescript-eslint/tslint-to-eslint-config
4+
5+
It represents the closest reasonable ESLint configuration to this
6+
project's original TSLint configuration.
7+
8+
We recommend eventually switching this configuration to extend from
9+
the recommended rulesets in typescript-eslint.
10+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
11+
12+
Happy linting! 💖
13+
*/
14+
module.exports = {
15+
"env": {
16+
"browser": true,
17+
"es6": true
18+
},
19+
"extends": [
20+
"plugin:@typescript-eslint/recommended",
21+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
22+
"prettier",
23+
],
24+
"parser": "@typescript-eslint/parser",
25+
"parserOptions": {
26+
"project": "tsconfig.json",
27+
"sourceType": "module"
28+
},
29+
"plugins": [
30+
"eslint-plugin-jsdoc",
31+
"eslint-plugin-prefer-arrow",
32+
"@typescript-eslint"
33+
],
34+
"rules": {
35+
"@typescript-eslint/adjacent-overload-signatures": "error",
36+
"@typescript-eslint/array-type": [
37+
"error",
38+
{
39+
"default": "array"
40+
}
41+
],
42+
"@typescript-eslint/ban-types": [
43+
"error",
44+
{
45+
"types": {
46+
"Object": {
47+
"message": "Avoid using the `Object` type. Did you mean `object`?"
48+
},
49+
"Function": {
50+
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
51+
},
52+
"Boolean": {
53+
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
54+
},
55+
"Number": {
56+
"message": "Avoid using the `Number` type. Did you mean `number`?"
57+
},
58+
"String": {
59+
"message": "Avoid using the `String` type. Did you mean `string`?"
60+
},
61+
"Symbol": {
62+
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
63+
}
64+
}
65+
}
66+
],
67+
"@typescript-eslint/consistent-type-assertions": "error",
68+
"@typescript-eslint/dot-notation": "error",
69+
"@typescript-eslint/naming-convention": "error",
70+
"@typescript-eslint/no-empty-function": "error",
71+
"@typescript-eslint/no-empty-interface": "error",
72+
"@typescript-eslint/no-explicit-any": "off",
73+
"@typescript-eslint/no-misused-new": "error",
74+
"@typescript-eslint/no-namespace": "error",
75+
"@typescript-eslint/no-parameter-properties": "off",
76+
"@typescript-eslint/no-shadow": [
77+
"error",
78+
{
79+
"hoist": "all"
80+
}
81+
],
82+
"@typescript-eslint/no-unused-expressions": "error",
83+
"@typescript-eslint/no-use-before-define": "off",
84+
"@typescript-eslint/no-var-requires": "error",
85+
"@typescript-eslint/prefer-for-of": "error",
86+
"@typescript-eslint/prefer-function-type": "error",
87+
"@typescript-eslint/prefer-namespace-keyword": "error",
88+
"@typescript-eslint/triple-slash-reference": [
89+
"error",
90+
{
91+
"path": "always",
92+
"types": "prefer-import",
93+
"lib": "always"
94+
}
95+
],
96+
"@typescript-eslint/unified-signatures": "error",
97+
"complexity": "off",
98+
"constructor-super": "error",
99+
"dot-notation": "error",
100+
"eqeqeq": [
101+
"error",
102+
"smart"
103+
],
104+
"guard-for-in": "error",
105+
"id-denylist": [
106+
"error",
107+
"any",
108+
"Number",
109+
"number",
110+
"String",
111+
"string",
112+
"Boolean",
113+
"boolean",
114+
"Undefined",
115+
"undefined"
116+
],
117+
"id-match": "error",
118+
"jsdoc/check-alignment": "error",
119+
"jsdoc/check-indentation": "error",
120+
"jsdoc/newline-after-description": "error",
121+
"max-classes-per-file": "off",
122+
"new-parens": "error",
123+
"no-bitwise": "error",
124+
"no-caller": "error",
125+
"no-cond-assign": "error",
126+
"no-console": "off",
127+
"no-debugger": "error",
128+
"no-empty": "error",
129+
"no-empty-function": "error",
130+
"no-eval": "error",
131+
"no-fallthrough": "off",
132+
"no-invalid-this": "off",
133+
"no-new-wrappers": "error",
134+
"no-shadow": "error",
135+
"no-throw-literal": "error",
136+
"no-trailing-spaces": "error",
137+
"no-undef-init": "error",
138+
"no-underscore-dangle": "error",
139+
"no-unsafe-finally": "error",
140+
"no-unused-expressions": "error",
141+
"no-unused-labels": "error",
142+
"no-use-before-define": "off",
143+
"no-var": "error",
144+
"object-shorthand": "error",
145+
"one-var": [
146+
"error",
147+
"never"
148+
],
149+
"prefer-arrow/prefer-arrow-functions": "error",
150+
"prefer-const": "error",
151+
"radix": "error",
152+
"spaced-comment": [
153+
"error",
154+
"always",
155+
{
156+
"markers": [
157+
"/"
158+
]
159+
}
160+
],
161+
"use-isnan": "error",
162+
"valid-typeof": "off"
163+
}
164+
};

Diff for: wasm/demo/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Diff for: wasm/demo/tslint-to-eslint-config.log

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
5 ESLint rules behave differently from their TSLint counterparts:
2+
* no-invalid-this:
3+
- Functions in methods will no longer be ignored.
4+
* @typescript-eslint/no-unused-expressions:
5+
- The TSLint optional config "allow-new" is the default ESLint behavior and will no longer be ignored.
6+
* prefer-arrow/prefer-arrow-functions:
7+
- ESLint does not support allowing standalone function declarations.
8+
- ESLint does not support allowing named functions defined with the function keyword.
9+
* eqeqeq:
10+
- Option "smart" allows for comparing two literal values, evaluating the value of typeof and null comparisons.
11+
* no-underscore-dangle:
12+
- Leading and trailing underscores (_) on identifiers will now be ignored.
13+

Diff for: wasm/tests-js/.eslintrc.js

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
/*
2+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
3+
https://github.com/typescript-eslint/tslint-to-eslint-config
4+
5+
It represents the closest reasonable ESLint configuration to this
6+
project's original TSLint configuration.
7+
8+
We recommend eventually switching this configuration to extend from
9+
the recommended rulesets in typescript-eslint.
10+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
11+
12+
Happy linting! 💖
13+
*/
14+
module.exports = {
15+
"env": {
16+
"browser": true,
17+
"es6": true
18+
},
19+
"extends": [
20+
"plugin:@typescript-eslint/recommended",
21+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
22+
"prettier",
23+
],
24+
"parser": "@typescript-eslint/parser",
25+
"parserOptions": {
26+
"project": "tsconfig.json",
27+
"sourceType": "module"
28+
},
29+
"plugins": [
30+
"eslint-plugin-jsdoc",
31+
"eslint-plugin-prefer-arrow",
32+
"@typescript-eslint"
33+
],
34+
"rules": {
35+
"@typescript-eslint/adjacent-overload-signatures": "error",
36+
"@typescript-eslint/array-type": [
37+
"error",
38+
{
39+
"default": "array"
40+
}
41+
],
42+
"@typescript-eslint/ban-types": [
43+
"error",
44+
{
45+
"types": {
46+
"Object": {
47+
"message": "Avoid using the `Object` type. Did you mean `object`?"
48+
},
49+
"Function": {
50+
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
51+
},
52+
"Boolean": {
53+
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
54+
},
55+
"Number": {
56+
"message": "Avoid using the `Number` type. Did you mean `number`?"
57+
},
58+
"String": {
59+
"message": "Avoid using the `String` type. Did you mean `string`?"
60+
},
61+
"Symbol": {
62+
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
63+
}
64+
}
65+
}
66+
],
67+
"@typescript-eslint/consistent-type-assertions": "error",
68+
"@typescript-eslint/dot-notation": "error",
69+
"@typescript-eslint/naming-convention": "error",
70+
"@typescript-eslint/no-empty-function": "error",
71+
"@typescript-eslint/no-empty-interface": "error",
72+
"@typescript-eslint/no-explicit-any": "off",
73+
"@typescript-eslint/no-misused-new": "error",
74+
"@typescript-eslint/no-namespace": "error",
75+
"@typescript-eslint/no-parameter-properties": "off",
76+
"@typescript-eslint/no-shadow": [
77+
"error",
78+
{
79+
"hoist": "all"
80+
}
81+
],
82+
"@typescript-eslint/no-unused-expressions": "error",
83+
"@typescript-eslint/no-use-before-define": "off",
84+
"@typescript-eslint/no-var-requires": "error",
85+
"@typescript-eslint/prefer-for-of": "error",
86+
"@typescript-eslint/prefer-function-type": "error",
87+
"@typescript-eslint/prefer-namespace-keyword": "error",
88+
"@typescript-eslint/triple-slash-reference": [
89+
"error",
90+
{
91+
"path": "always",
92+
"types": "prefer-import",
93+
"lib": "always"
94+
}
95+
],
96+
"@typescript-eslint/unified-signatures": "error",
97+
"complexity": "off",
98+
"constructor-super": "error",
99+
"dot-notation": "error",
100+
"eqeqeq": [
101+
"error",
102+
"smart"
103+
],
104+
"guard-for-in": "error",
105+
"id-denylist": [
106+
"error",
107+
"any",
108+
"Number",
109+
"number",
110+
"String",
111+
"string",
112+
"Boolean",
113+
"boolean",
114+
"Undefined",
115+
"undefined"
116+
],
117+
"id-match": "error",
118+
"jsdoc/check-alignment": "error",
119+
"jsdoc/check-indentation": "error",
120+
"jsdoc/newline-after-description": "error",
121+
"max-classes-per-file": [
122+
"error",
123+
1
124+
],
125+
"new-parens": "error",
126+
"no-bitwise": "error",
127+
"no-caller": "error",
128+
"no-cond-assign": "error",
129+
"no-console": "error",
130+
"no-debugger": "error",
131+
"no-empty": "error",
132+
"no-empty-function": "error",
133+
"no-eval": "error",
134+
"no-fallthrough": "off",
135+
"no-invalid-this": "off",
136+
"no-new-wrappers": "error",
137+
"no-shadow": "error",
138+
"no-throw-literal": "error",
139+
"no-trailing-spaces": "error",
140+
"no-undef-init": "error",
141+
"no-underscore-dangle": "error",
142+
"no-unsafe-finally": "error",
143+
"no-unused-expressions": "error",
144+
"no-unused-labels": "error",
145+
"no-use-before-define": "off",
146+
"no-var": "error",
147+
"object-shorthand": "error",
148+
"one-var": [
149+
"error",
150+
"never"
151+
],
152+
"prefer-arrow/prefer-arrow-functions": "error",
153+
"prefer-const": "error",
154+
"radix": "error",
155+
"spaced-comment": [
156+
"error",
157+
"always",
158+
{
159+
"markers": [
160+
"/"
161+
]
162+
}
163+
],
164+
"use-isnan": "error",
165+
"valid-typeof": "off"
166+
}
167+
};

Diff for: wasm/tests-js/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Diff for: wasm/tests-js/tslint-to-eslint-config.log

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
5 ESLint rules behave differently from their TSLint counterparts:
2+
* no-invalid-this:
3+
- Functions in methods will no longer be ignored.
4+
* @typescript-eslint/no-unused-expressions:
5+
- The TSLint optional config "allow-new" is the default ESLint behavior and will no longer be ignored.
6+
* prefer-arrow/prefer-arrow-functions:
7+
- ESLint does not support allowing standalone function declarations.
8+
- ESLint does not support allowing named functions defined with the function keyword.
9+
* eqeqeq:
10+
- Option "smart" allows for comparing two literal values, evaluating the value of typeof and null comparisons.
11+
* no-underscore-dangle:
12+
- Leading and trailing underscores (_) on identifiers will now be ignored.
13+

0 commit comments

Comments
 (0)