-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from axonivy/eslint9
Eslint9
- Loading branch information
Showing
50 changed files
with
1,300 additions
and
1,394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'; | ||
import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'; | ||
import reactHooks from 'eslint-plugin-react-hooks'; | ||
import reactCompiler from 'eslint-plugin-react-compiler'; | ||
import testingLibrary from 'eslint-plugin-testing-library'; | ||
import playwright from 'eslint-plugin-playwright'; | ||
import pluginQuery from '@tanstack/eslint-plugin-query'; | ||
import globals from 'globals'; | ||
|
||
export default tseslint.config( | ||
// Base eslint recommended config | ||
eslint.configs.recommended, | ||
|
||
// TypeScript recommended configs | ||
...tseslint.configs.strict, | ||
{ | ||
name: 'typescript-eslint', | ||
languageOptions: { | ||
parserOptions: { | ||
project: true, // Uses tsconfig.json from current directory | ||
tsconfigRootDir: import.meta.dirname | ||
} | ||
} | ||
}, | ||
|
||
// React recommended configs | ||
{ | ||
name: 'eslint-plugin-react/configs/recommended', | ||
...reactRecommended | ||
}, | ||
{ | ||
name: 'eslint-plugin-react/configs/jsx-runtime', | ||
...reactJsxRuntime | ||
}, | ||
{ | ||
name: 'eslint-plugin-react', | ||
languageOptions: { | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
}, | ||
globals: { | ||
...globals.browser | ||
} | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
}, | ||
rules: { | ||
'react/display-name': 'off' | ||
} | ||
}, | ||
{ | ||
name: 'eslint-plugin-react-hooks', | ||
plugins: { | ||
'react-hooks': reactHooks | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules | ||
} | ||
}, | ||
{ | ||
name: 'eslint-plugin-react-compiler', | ||
plugins: { | ||
'react-compiler': reactCompiler | ||
}, | ||
rules: { | ||
'react-compiler/react-compiler': 'error' | ||
} | ||
}, | ||
|
||
// Testing library recommended configs | ||
{ | ||
name: 'eslint-plugin-testing-library', | ||
files: ['**/*.test.{js,mjs,cjs,ts,jsx,tsx}'], | ||
...testingLibrary.configs['flat/react'] | ||
}, | ||
|
||
// Playwright recommended configs | ||
{ | ||
name: 'eslint-plugin-playwright', | ||
files: ['**/*.spec.{js,mjs,cjs,ts,jsx,tsx}'], | ||
...playwright.configs['flat/recommended'], | ||
rules: { | ||
...playwright.configs['flat/recommended'].rules, | ||
'playwright/expect-expect': 'off' | ||
} | ||
}, | ||
|
||
// Tanstack recommended configs | ||
{ | ||
name: '@tanstack/eslint-plugin-query', | ||
plugins: { | ||
'@tanstack/query': pluginQuery | ||
}, | ||
rules: { | ||
...pluginQuery.configs.recommended.rules | ||
} | ||
}, | ||
|
||
// Project-specific overrides and custom rules | ||
{ | ||
name: 'ingored-files', | ||
ignores: [ | ||
'**/node_modules/**', | ||
'eslint.config.*', | ||
'**/vite*.config.*', | ||
'**/playwright.config.*', | ||
'**/*.d.ts', | ||
'**/lib/*', | ||
'**/build/*', | ||
'**/schemaCodegen.cjs' | ||
] | ||
}, | ||
{ | ||
name: 'packages/core', | ||
files: ['packages/core/**/*.{js,mjs,cjs,ts,jsx,tsx}'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off' | ||
} | ||
} | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.