Skip to content

Commit 0005352

Browse files
committed
chore: modify rules in warn
1 parent 6c8f001 commit 0005352

File tree

5 files changed

+266
-154
lines changed

5 files changed

+266
-154
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.mjs

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@ import tsdoc from "eslint-plugin-tsdoc";
22
import typescriptParser from "@typescript-eslint/parser";
33
import scwTypescript from '@scaleway/eslint-config-react/typescript';
44

5+
6+
const scwPlugins = scwTypescript.reduce((acc, config) => {
7+
return { ...acc, ...config.plugins };
8+
}, {});
9+
510
export default [
6-
...scwTypescript,
711
{
812
ignores: [
913
"**/node_modules/",
1014
"**/dist/",
1115
"**/examples/",
12-
"**/vite.config.ts"
16+
"**/vite.config.ts",
17+
"packages/clients/.eslintrc.cjs",
18+
"eslint.config.mjs",
19+
"packages/clients/src/vendor/base64/index.js",
20+
"packages/configuration-loader/.eslintrc.cjs",
21+
1322
],
1423
},
1524
{
@@ -23,6 +32,7 @@ export default [
2332
},
2433
plugins: {
2534
tsdoc,
35+
...scwPlugins,
2636
},
2737
rules: {
2838
"tsdoc/syntax": "warn",
@@ -37,30 +47,63 @@ export default [
3747
"import/no-default-export": "error",
3848
"no-await-in-loop": "off",
3949
"@typescript-eslint/no-namespace": "off",
40-
"@typescript-eslint/consistent-type-definitions": "off",
41-
4250
},
4351
},
44-
{
52+
53+
...scwTypescript.map(config => ({
54+
...config,
55+
files: ['**/*.ts', '**/*.tsx'],
56+
rules: {
57+
...config.rules,
58+
//new rules
59+
"no-restricted-syntax": "warn",
60+
"no-useless-escape": "warn",
61+
"max-classes-per-file": "warn",
62+
"no-underscore-dangle": "warn",
63+
"no-await-in-loop": "warn",
64+
"@typescript-eslint/no-unused-vars": "warn",
65+
"@typescript-eslint/consistent-type-definitions": "warn",
66+
"@typescript-eslint/ban-types": "warn",
67+
},
68+
})),
69+
70+
...scwTypescript.map(config => ({
71+
...config,
4572
files: [
46-
"packages/clients/src/scw/**/*.ts",
47-
"packages/clients/src/internal/**/*.ts",
73+
"./packages/clients/src/scw/**/*.ts",
74+
"./packages/clients/src/internal/**/*.ts",
4875
],
4976
rules: {
77+
...config.rules,
78+
"@typescript-eslint/no-unused-vars": "off",
5079
"@typescript-eslint/consistent-type-definitions": "off",
5180
},
52-
},
53-
{
81+
82+
})),
83+
84+
...scwTypescript.map(config => ({
85+
...config,
5486
files: ["**/*.test.ts", "__tests__/**/*.ts", "**/vite.config.ts"],
5587
rules: {
88+
...config.rules,
5689
"import/no-extraneous-dependencies": "off",
5790
},
58-
},
59-
{
91+
92+
})),
93+
94+
...scwTypescript.map(config => ({
95+
...config,
6096
files: ["packages/clients/src/api/dedibox/v1/*.ts"],
6197
rules: {
98+
...config.rules,
6299
"no-use-before-define": "off",
63100
"@typescript-eslint/no-use-before-define": "off",
101+
"@typescript-eslint/no-unused-vars": "off",
102+
"@typescript-eslint/consistent-type-definitions": "off",
103+
"max-classes-per-file": "off",
104+
"no-restricted-syntax": "off",
64105
},
65-
}
106+
107+
})),
108+
66109
];

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@commitlint/cli": "19.5.0",
4848
"@commitlint/config-conventional": "19.5.0",
4949
"@scaleway/eslint-config-react": "4.0.8",
50+
"@typescript-eslint/eslint-plugin": "latest",
5051
"@vitest/coverage-istanbul": "2.0.5",
5152
"@vitest/coverage-v8": "2.0.5",
5253
"@vitest/ui": "2.0.5",
@@ -56,7 +57,7 @@
5657
"cross-fetch": "4.0.0",
5758
"cz-conventional-changelog": "3.3.0",
5859
"esbuild-plugin-browserslist": "0.14.0",
59-
"eslint": "9.4.0",
60+
"eslint": "9.7.0",
6061
"eslint-plugin-tsdoc": "0.3.0",
6162
"husky": "9.1.6",
6263
"jsdom": "25.0.0",

0 commit comments

Comments
 (0)