-
Notifications
You must be signed in to change notification settings - Fork 15
Upgrade eslint from v8 to v9 #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-FileCopyrightText: 2025 Friedrich-Alexander-Universitat Erlangen-Nurnberg | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import baseConfig from '../../eslint.config.mjs'; | ||
import { dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
export default [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
...baseConfig, | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
project: [ | ||
'./tsconfig.app.json', | ||
'./tsconfig.spec.json', | ||
], | ||
tsconfigRootDir: dirname(fileURLToPath(import.meta.url)) | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
{ | ||
files: ['**/*.js', '**/*.jsx'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
{ | ||
ignores: ['**/vite.config.*.timestamp*', '**/vitest.config.*.timestamp*'], | ||
}, | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"**/*.test.ts" | ||
], | ||
"include": [ | ||
"**/*.ts" | ||
"**/*.ts", | ||
"eslint.config.mjs" | ||
] | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-FileCopyrightText: 2025 Friedrich-Alexander-Universitat Erlangen-Nurnberg | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import { defineConfig, globalIgnores } from "eslint/config"; | ||
import baseConfig from "../../eslint.config.mjs"; | ||
import { dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
export default defineConfig(baseConfig, [globalIgnores(["!**/*"]), { | ||
languageOptions: { | ||
ecmaVersion: 5, | ||
sourceType: "script", | ||
|
||
parserOptions: { | ||
project: ["./tsconfig.app.json"], | ||
tsconfigRootDir: dirname(fileURLToPath(import.meta.url)) | ||
}, | ||
}, | ||
}, { | ||
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], | ||
rules: {}, | ||
}, { | ||
files: ["**/*.ts", "**/*.tsx"], | ||
rules: {}, | ||
}, { | ||
files: ["**/*.js", "**/*.jsx"], | ||
rules: {}, | ||
}]); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"types": ["node"] | ||
"types": [ | ||
"node" | ||
] | ||
}, | ||
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"], | ||
"include": ["src/**/*.ts"] | ||
"exclude": [ | ||
"src/**/*.spec.ts", | ||
"src/**/*.test.ts" | ||
], | ||
"include": [ | ||
"src/**/*.ts", | ||
"eslint.config.mjs" | ||
] | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-FileCopyrightText: 2025 Friedrich-Alexander-Universitat Erlangen-Nurnberg | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import baseConfig from '../../eslint.config.mjs'; | ||
import { dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
const configs = [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
...baseConfig, | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['./tsconfig.app.json'], | ||
tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), | ||
}, | ||
}, | ||
}, | ||
{ | ||
ignores: [ | ||
'**/.docusaurus/**', | ||
'**/theme/prism-jayvee.js', | ||
'**/*.config.js', | ||
'**/prism-include-languages.js', | ||
'**/sidebars.js', | ||
], | ||
}, | ||
]; | ||
|
||
// HACK: Somehow the typescript-eslint plugin is not always recognized, | ||
// despite being part of the config. The workaround is to extract the plugin, | ||
// and reinsert it at the end | ||
const typescriptEslintPlugins = configs.flatMap((config) => { | ||
const plugin = config.plugins?.['@typescript-eslint']; | ||
return plugin !== undefined ? [plugin] : []; | ||
}); | ||
|
||
const typescriptEslintPlugin = typescriptEslintPlugins.reduce((prev, curr) => { | ||
if (Object.entries(prev).some(([key, value]) => curr[key] !== value)) { | ||
throw new Error('Must be same values') | ||
} | ||
return prev; | ||
}); | ||
|
||
|
||
export default [...configs, | ||
{plugins: {"@typescript-eslint": typescriptEslintPlugin}} | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't formatted properly is it? Also, it uses tabs instead of spaces.