🚨(packages) fix eslint tsconfig root dir

Eslint extension highlighted some issues with the way we were
importing the tsconfig.json file in the .eslintrc.json file.
By changing the extension to .cjs, we are now able to set
tsconfigRootDir to the root of the package thanks to `dirname`.
It helps eslint to find the correct tsconfig.json file.
This commit is contained in:
Anthony Le Courric
2023-08-03 12:08:55 +02:00
committed by Jean-Baptiste PENRATH
parent c880222c12
commit b46aaa66ed
7 changed files with 41 additions and 27 deletions

View File

@@ -87,5 +87,6 @@
"import/resolver": {
"typescript": true
}
}
},
"ignorePatterns": ["node_modules/", "dist/"]
}

View File

@@ -0,0 +1,24 @@
module.exports = {
root: true,
extends: ["custom"],
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.eslint.json"],
},
rules: {
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"vite.config.ts",
"vite.icons.config.ts",
"vite.fonts.config.ts",
"cunningham.ts",
"**/*.stories.tsx",
"**/*.spec.tsx",
"src/tests/*",
],
},
],
},
};

View File

@@ -1,12 +0,0 @@
{
"root": true,
"extends": [
"custom"
],
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"rules": {
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["vite.config.ts", "vite.icons.config.ts", "vite.fonts.config.ts","cunningham.ts","**/*.stories.tsx", "**/*.spec.tsx", "src/tests/*"]}]
}
}

View File

@@ -3,6 +3,7 @@
"exclude": [],
"include": [
"**/*.ts",
"**/*.tsx"
"**/*.tsx",
".eslintrc.cjs"
]
}

View File

@@ -0,0 +1,12 @@
module.exports = {
root: true,
extends: ["custom"],
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.eslint.json"],
},
rules: {
"no-console": "off",
"no-eval": "off",
},
};

View File

@@ -1,13 +0,0 @@
{
"root": true,
"extends": [
"custom"
],
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"rules": {
"no-console": "off",
"no-eval": "off"
}
}

View File

@@ -2,5 +2,6 @@
"include": [
"**/*.ts",
"**/*.js",
".eslintrc.cjs"
]
}