forked from scaleway/scaleway-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate to eslint9 (scaleway#1529)
- Loading branch information
Showing
7 changed files
with
2,376 additions
and
5,198 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import tsdoc from "eslint-plugin-tsdoc"; | ||
import typescriptParser from "@typescript-eslint/parser"; | ||
import scwTypescript from '@scaleway/eslint-config-react/typescript'; | ||
|
||
|
||
const scwPlugins = scwTypescript.reduce((acc, config) => { | ||
return { ...acc, ...config.plugins }; | ||
}, {}); | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
"**/node_modules/", | ||
"**/dist/", | ||
"**/examples/", | ||
"**/vite.config.ts", | ||
"packages/clients/.eslintrc.cjs", | ||
"eslint.config.mjs", | ||
"packages/clients/src/vendor/base64/index.js", | ||
"packages/configuration-loader/.eslintrc.cjs", | ||
|
||
], | ||
}, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 5, | ||
sourceType: "script", | ||
parser: typescriptParser, | ||
parserOptions: { | ||
project: ["tsconfig.json"], | ||
}, | ||
}, | ||
plugins: { | ||
tsdoc, | ||
...scwPlugins, | ||
}, | ||
rules: { | ||
"tsdoc/syntax": "warn", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
selector: "enumMember", | ||
format: ["PascalCase"], | ||
}, | ||
], | ||
"import/prefer-default-export": "off", | ||
"import/no-default-export": "error", | ||
"no-await-in-loop": "off", | ||
"@typescript-eslint/no-namespace": "off", | ||
}, | ||
}, | ||
|
||
...scwTypescript.map(config => ({ | ||
...config, | ||
files: ['**/*.ts', '**/*.tsx'], | ||
rules: { | ||
...config.rules, | ||
//new rules | ||
"no-restricted-syntax": "warn", | ||
"no-useless-escape": "warn", | ||
"max-classes-per-file": "warn", | ||
"no-underscore-dangle": "warn", | ||
"no-await-in-loop": "warn", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/consistent-type-definitions": "warn", | ||
"@typescript-eslint/ban-types": "warn", | ||
}, | ||
})), | ||
|
||
...scwTypescript.map(config => ({ | ||
...config, | ||
files: [ | ||
"./packages/clients/src/scw/**/*.ts", | ||
"./packages/clients/src/internal/**/*.ts", | ||
], | ||
rules: { | ||
...config.rules, | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/consistent-type-definitions": "off", | ||
}, | ||
|
||
})), | ||
|
||
...scwTypescript.map(config => ({ | ||
...config, | ||
files: ["**/*.test.ts", "__tests__/**/*.ts", "**/vite.config.ts"], | ||
rules: { | ||
...config.rules, | ||
"import/no-extraneous-dependencies": "off", | ||
}, | ||
|
||
})), | ||
|
||
...scwTypescript.map(config => ({ | ||
...config, | ||
files: ["packages/clients/src/api/dedibox/v1/*.ts"], | ||
rules: { | ||
...config.rules, | ||
"no-use-before-define": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/consistent-type-definitions": "off", | ||
"max-classes-per-file": "off", | ||
"no-restricted-syntax": "off", | ||
}, | ||
|
||
})), | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.