-
Notifications
You must be signed in to change notification settings - Fork 6
chore: upgrade to eslint v9 #424
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
b78d225
00db023
6d57b00
2d53228
6c89f6d
711a324
f4603e3
f3cdcab
cc3a845
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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,11 @@ CVE-2025-68429 | |
| # tar | ||
|
|
||
| CVE-2026-23745 | ||
|
|
||
| # ajv | ||
|
|
||
| CVE-2025-69873 | ||
|
|
||
| # minimatch | ||
|
|
||
| CVE-2026-26996 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| const { defineConfig, globalIgnores } = require('eslint/config') | ||
|
|
||
| const js = require('@eslint/js') | ||
| const tseslint = require('typescript-eslint') | ||
| const importPlugin = require('eslint-plugin-import') | ||
| const jestPlugin = require('eslint-plugin-jest') | ||
| const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended') | ||
| const reactPlugin = require('eslint-plugin-react') | ||
| const storybook = require('eslint-plugin-storybook') | ||
| const globals = require('globals') | ||
|
|
||
| module.exports = defineConfig([ | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| reactPlugin.configs.flat.recommended, | ||
| importPlugin.flatConfigs.recommended, | ||
| importPlugin.flatConfigs.typescript, | ||
| eslintPluginPrettierRecommended, | ||
| ], | ||
|
|
||
| languageOptions: { | ||
| ecmaVersion: 6, | ||
| sourceType: 'module', | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| }, | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
|
|
||
| rules: { | ||
| '@typescript-eslint/no-require-imports': 0, | ||
| '@typescript-eslint/no-unused-expressions': 0, | ||
| '@typescript-eslint/ban-ts-ignore': 0, | ||
| '@typescript-eslint/ban-ts-comment': 0, | ||
| '@typescript-eslint/explicit-function-return-type': 0, | ||
| '@typescript-eslint/explicit-module-boundary-types': 0, | ||
| '@typescript-eslint/no-explicit-any': 0, | ||
| '@typescript-eslint/no-empty-function': 0, | ||
| '@typescript-eslint/no-restricted-types': 0, | ||
| '@typescript-eslint/no-unsafe-function-type': 0, | ||
| '@typescript-eslint/no-wrapper-object-types': 0, | ||
| 'no-shadow': 0, | ||
| 'import/named': 0, | ||
| 'prettier/prettier': 'error', | ||
| 'react/jsx-uses-react': 'off', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'import/order': [ | ||
| 'error', | ||
| { | ||
| alphabetize: { | ||
| order: 'asc', | ||
| }, | ||
|
|
||
| groups: [ | ||
| 'builtin', | ||
| 'external', | ||
| 'internal', | ||
| 'parent', | ||
| 'sibling', | ||
| 'index', | ||
| 'object', | ||
| 'type', | ||
| ], | ||
|
|
||
| 'newlines-between': 'never', | ||
| }, | ||
| ], | ||
|
|
||
| 'react/prop-types': 0, | ||
| }, | ||
|
|
||
| settings: { | ||
| react: { | ||
| version: 'detect', | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| files: ['**/*.{spec,test}.{ts,tsx}'], | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. separate, so it is only applied to test files |
||
| plugins: { | ||
| jest: jestPlugin, | ||
| }, | ||
| languageOptions: { | ||
| globals: jestPlugin.environments.globals.globals, | ||
| }, | ||
| rules: { | ||
| 'jest/no-disabled-tests': 'warn', | ||
| 'jest/no-focused-tests': 'error', | ||
| 'jest/no-identical-title': 'error', | ||
| 'jest/prefer-to-have-length': 'warn', | ||
| 'jest/valid-expect': 'error', | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| settings: { | ||
| 'import/resolver': { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to resolve aliases based on tsconfig |
||
| typescript: true, | ||
| node: true, | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| ...storybook.configs['flat/recommended'], | ||
|
|
||
| globalIgnores([ | ||
| '**/.devcontainer', | ||
| '**/.github', | ||
| '**/.vscode', | ||
| '**/node_modules', | ||
| '**/dist', | ||
| '!.storybook', | ||
| '**/*.js', | ||
| ]), | ||
| ]) | ||
This file was deleted.
This file was deleted.
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.
eslint 9 doesn't support
env:to set the globals anymore, so we need theglobalspackage (if we're not hardcoding all the globals we need). See https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables