Merged in chore/eslint9 (pull request #2029)
chore: Update to ESLint 9 * wip: apply codemod and upgrade swc plugin * Update eslint to 9 in scandic-web apply code mod to config fix existing lint issues * Remove uneccessary fixupConfigRules * Update eslint to 9 in design-system * Add lint turbo dependency * Move redis-api to eslint and prettier instead of biome * Simplify eslint configs * Clean up * Apply linting Approved-by: Linus Flood
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: { browser: true, es2020: true },
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
'plugin:storybook/recommended',
|
||||
],
|
||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['react-refresh'],
|
||||
rules: {
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -16,6 +16,6 @@ const config: StorybookConfig = {
|
||||
}
|
||||
export default config
|
||||
|
||||
function getAbsolutePath(value: string): any {
|
||||
function getAbsolutePath(value: string) {
|
||||
return dirname(require.resolve(join(value, 'package.json')))
|
||||
}
|
||||
|
||||
40
packages/design-system/eslint.config.mjs
Normal file
40
packages/design-system/eslint.config.mjs
Normal file
@@ -0,0 +1,40 @@
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
import globals from 'globals'
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import js from '@eslint/js'
|
||||
|
||||
const compat = new FlatCompat({
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
})
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
parser: tsParser,
|
||||
},
|
||||
extends: compat.extends(
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
'plugin:storybook/recommended'
|
||||
),
|
||||
plugins: {
|
||||
'react-refresh': reactRefresh,
|
||||
},
|
||||
rules: {
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{
|
||||
allowConstantExport: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
globalIgnores(['**/dist', '**/.eslintrc.cjs']),
|
||||
])
|
||||
@@ -134,6 +134,8 @@
|
||||
"react-dom": "^19.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.26.0",
|
||||
"@storybook/addon-essentials": "^8.6.12",
|
||||
"@storybook/addon-interactions": "^8.6.12",
|
||||
"@storybook/addon-links": "^8.6.12",
|
||||
@@ -153,11 +155,12 @@
|
||||
"colord": "^2.9.3",
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"deepmerge-ts": "^7.1.5",
|
||||
"eslint": "^8",
|
||||
"eslint": "^9",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.20",
|
||||
"eslint-plugin-storybook": "^0.12.0",
|
||||
"glob": "^11.0.2",
|
||||
"globals": "^16.1.0",
|
||||
"husky": "^9.1.7",
|
||||
"jiti": "^1.21.0",
|
||||
"lint-staged": "^15.5.2",
|
||||
|
||||
Reference in New Issue
Block a user