Skip to content

Commit 0943911

Browse files
committed
chore: fix web-components lint setup to avoid leaking rules to json parser scope
1 parent c3a9a3a commit 0943911

File tree

2 files changed

+88
-86
lines changed

2 files changed

+88
-86
lines changed
Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
22
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"plugins": ["@typescript-eslint", "import"],
5-
"extends": [
6-
"eslint:recommended",
7-
"plugin:@typescript-eslint/eslint-recommended",
8-
"plugin:@typescript-eslint/recommended",
9-
"prettier"
10-
],
11-
"rules": {
12-
"@typescript-eslint/explicit-module-boundary-types": "off"
13-
}
3+
"overrides": [
4+
{
5+
"files": ["src/**/*.{ts,tsx}"],
6+
"parser": "@typescript-eslint/parser",
7+
"plugins": ["@typescript-eslint", "import"],
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"prettier"
13+
],
14+
"rules": {
15+
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
16+
"@typescript-eslint/explicit-module-boundary-types": "off"
17+
}
18+
}
19+
]
1420
}

packages/web-components/.eslintrc.json

Lines changed: 71 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,79 @@
11
{
22
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"plugins": ["@typescript-eslint", "import"],
5-
"extends": [
6-
"eslint:recommended",
7-
"plugin:@typescript-eslint/eslint-recommended",
8-
"plugin:@typescript-eslint/recommended",
9-
"prettier",
10-
"plugin:playwright/recommended"
11-
],
12-
"settings": {
13-
"react": {
14-
"version": "latest"
15-
}
16-
},
17-
"rules": {
18-
"no-empty": [
19-
"error",
20-
{
21-
"allowEmptyCatch": true
22-
}
23-
],
24-
"no-extra-boolean-cast": "off",
25-
"no-prototype-builtins": "off",
26-
"no-fallthrough": "off",
27-
"no-unexpected-multiline": "off",
28-
"no-useless-escape": "off",
29-
"import/order": "error",
30-
"sort-imports": [
31-
"error",
32-
{
33-
"ignoreCase": true,
34-
"ignoreDeclarationSort": true
35-
}
36-
],
37-
"comma-dangle": "off",
38-
"prefer-const": ["error", { "destructuring": "all" }],
39-
"@typescript-eslint/no-non-null-assertion": "off",
40-
"@typescript-eslint/no-use-before-define": "off",
41-
"@typescript-eslint/no-empty-interface": "error",
42-
"@typescript-eslint/no-empty-object-type": "off",
43-
"@typescript-eslint/no-unsafe-declaration-merging": "off",
44-
"@typescript-eslint/explicit-module-boundary-types": "off",
45-
"@typescript-eslint/explicit-function-return-type": "off",
46-
"@typescript-eslint/camelcase": "off",
47-
"@typescript-eslint/no-inferrable-types": "off",
48-
"@typescript-eslint/no-unused-vars": [
49-
"warn",
50-
{
51-
"args": "none"
52-
}
53-
],
54-
"@typescript-eslint/no-unused-expressions": "warn",
55-
"@typescript-eslint/no-explicit-any": "off",
56-
"@typescript-eslint/naming-convention": [
57-
"error",
58-
{
59-
"selector": "default",
60-
"format": ["UPPER_CASE", "camelCase", "PascalCase"],
61-
"leadingUnderscore": "allow"
62-
},
63-
{
64-
"selector": "property",
65-
"format": null // disable for property names because of our foo__expanded convention for JSS
66-
// TODO: I think we can come up with a regex that ignores variables with __ in them
67-
},
68-
{
69-
"selector": "variable",
70-
"format": null // disable for variable names because of our foo__expanded convention for JSS
71-
// TODO: I think we can come up with a regex that ignores variables with __ in them
72-
}
73-
]
74-
},
753
"overrides": [
764
{
77-
"files": ["**/*.json"],
5+
"files": ["**/*.{js,ts,tsx}"],
6+
"parser": "@typescript-eslint/parser",
7+
"plugins": ["@typescript-eslint", "import"],
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"prettier",
13+
"plugin:playwright/recommended"
14+
],
15+
"settings": {
16+
"react": {
17+
"version": "latest"
18+
}
19+
},
7820
"rules": {
79-
"@typescript-eslint/naming-convention": "off",
80-
"@typescript-eslint/no-unused-expressions": "off"
21+
"no-empty": [
22+
"error",
23+
{
24+
"allowEmptyCatch": true
25+
}
26+
],
27+
"no-extra-boolean-cast": "off",
28+
"no-prototype-builtins": "off",
29+
"no-fallthrough": "off",
30+
"no-unexpected-multiline": "off",
31+
"no-useless-escape": "off",
32+
"import/order": "error",
33+
"sort-imports": [
34+
"error",
35+
{
36+
"ignoreCase": true,
37+
"ignoreDeclarationSort": true
38+
}
39+
],
40+
"comma-dangle": "off",
41+
"prefer-const": ["error", { "destructuring": "all" }],
42+
"@typescript-eslint/no-non-null-assertion": "off",
43+
"@typescript-eslint/no-use-before-define": "off",
44+
"@typescript-eslint/no-empty-interface": "error",
45+
"@typescript-eslint/no-empty-object-type": "off",
46+
"@typescript-eslint/no-unsafe-declaration-merging": "off",
47+
"@typescript-eslint/explicit-module-boundary-types": "off",
48+
"@typescript-eslint/explicit-function-return-type": "off",
49+
"@typescript-eslint/camelcase": "off",
50+
"@typescript-eslint/no-inferrable-types": "off",
51+
"@typescript-eslint/no-unused-vars": [
52+
"warn",
53+
{
54+
"args": "none"
55+
}
56+
],
57+
"@typescript-eslint/no-unused-expressions": "warn",
58+
"@typescript-eslint/no-explicit-any": "off",
59+
"@typescript-eslint/naming-convention": [
60+
"error",
61+
{
62+
"selector": "default",
63+
"format": ["UPPER_CASE", "camelCase", "PascalCase"],
64+
"leadingUnderscore": "allow"
65+
},
66+
{
67+
"selector": "property",
68+
"format": null // disable for property names because of our foo__expanded convention for JSS
69+
// TODO: I think we can come up with a regex that ignores variables with __ in them
70+
},
71+
{
72+
"selector": "variable",
73+
"format": null // disable for variable names because of our foo__expanded convention for JSS
74+
// TODO: I think we can come up with a regex that ignores variables with __ in them
75+
}
76+
]
8177
}
8278
}
8379
]

0 commit comments

Comments
 (0)