Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

46 changes: 0 additions & 46 deletions .eslintrc

This file was deleted.

109 changes: 109 additions & 0 deletions eslint.config.mjs
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",
},

})),

];
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"commit": "npx git-cz -a",
"doc": "typedoc",
"format": "prettier --write '**/*.ts'",
"lint": "eslint --cache --ext ts .",
"lint": "eslint --cache .",
"prepare": "husky",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
Expand All @@ -24,7 +24,7 @@
"lint-staged": {
"*.ts": [
"prettier --write",
"eslint --fix --ext ts"
"eslint --fix ."
],
"*.yaml": [
"prettier --write"
Expand All @@ -46,7 +46,8 @@
"devDependencies": {
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@scaleway/eslint-config-react": "3.18.4",
"@scaleway/eslint-config-react": "4.0.8",
"@typescript-eslint/eslint-plugin": "latest",
"@vitest/coverage-istanbul": "2.0.5",
"@vitest/coverage-v8": "2.0.5",
"@vitest/ui": "2.0.5",
Expand All @@ -56,7 +57,7 @@
"cross-fetch": "4.0.0",
"cz-conventional-changelog": "3.3.0",
"esbuild-plugin-browserslist": "0.14.0",
"eslint": "8.57.0",
"eslint": "9.7.0",
"eslint-plugin-tsdoc": "0.3.0",
"husky": "9.1.6",
"jsdom": "25.0.0",
Expand Down
Loading
Loading