@@ -2,14 +2,23 @@ import tsdoc from "eslint-plugin-tsdoc";
22import typescriptParser from "@typescript-eslint/parser" ;
33import scwTypescript from '@scaleway/eslint-config-react/typescript' ;
44
5+
6+ const scwPlugins = scwTypescript . reduce ( ( acc , config ) => {
7+ return { ...acc , ...config . plugins } ;
8+ } , { } ) ;
9+
510export 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] ;
0 commit comments