Skip to content

Commit c360271

Browse files
committed
refactor: simplify common ESLint config
1 parent 3c0fb90 commit c360271

File tree

4 files changed

+63
-51
lines changed

4 files changed

+63
-51
lines changed

.eslintrc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [".eslintrc.js", "src/wasm/", "msfstypes/"],
4+
"env": { "browser": true, "commonjs": true, "es6": true },
5+
"plugins": ["@typescript-eslint"],
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
10+
"plugin:prettier/recommended"
11+
],
12+
"rules": {
13+
"no-console": ["warn", { "allow": ["warn", "error", "time", "timeEnd", "info"] }],
14+
"@typescript-eslint/func-call-spacing": ["warn"],
15+
"@typescript-eslint/no-shadow": "warn",
16+
"@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
17+
"@typescript-eslint/explicit-module-boundary-types": "off",
18+
"@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }],
19+
"@typescript-eslint/no-explicit-any": "error",
20+
"no-unused-vars": "off",
21+
"@typescript-eslint/no-unused-vars": [
22+
"warn",
23+
{
24+
"vars": "all",
25+
"varsIgnorePattern": "^_",
26+
"args": "after-used",
27+
"argsIgnorePattern": "^_",
28+
"ignoreRestSiblings": true,
29+
"destructuredArrayIgnorePattern": "^_"
30+
}
31+
],
32+
"@typescript-eslint/no-misused-promises": [
33+
"warn",
34+
{
35+
"checksConditionals": true,
36+
"checksVoidReturn": false,
37+
"checksSpreads": true
38+
}
39+
],
40+
"@typescript-eslint/interface-name-prefix": "off",
41+
"@typescript-eslint/explicit-function-return-type": "off"
42+
}
43+
}

.eslintrc.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

examples/gauge/.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
extends: "../../.eslintrc",
3+
parserOptions: {
4+
tsconfigRootDir: __dirname,
5+
project: ["./tsconfig.json"],
6+
ecmaVersion: 2022,
7+
sourceType: "module",
8+
ecmaFeatures: { jsx: true },
9+
jsxPragma: "FSComponent",
10+
},
11+
}

src/js/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
extends: "../../.eslintrc",
3+
parserOptions: {
4+
tsconfigRootDir: __dirname,
5+
project: ["./tsconfig.json"],
6+
ecmaVersion: 2022,
7+
sourceType: "module",
8+
},
9+
}

0 commit comments

Comments
 (0)