|
|
@@ -3,7 +3,11 @@ import tseslint from 'typescript-eslint';
|
|
|
import react from 'eslint-plugin-react';
|
|
|
import prettier from 'eslint-plugin-prettier/recommended';
|
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
|
+import importX from 'eslint-plugin-import-x';
|
|
|
+import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
|
import cypress from 'eslint-plugin-cypress';
|
|
|
+import jest from 'eslint-plugin-jest';
|
|
|
+import testingLibrary from 'eslint-plugin-testing-library';
|
|
|
import globals from 'globals';
|
|
|
|
|
|
export default tseslint.config(
|
|
|
@@ -11,35 +15,65 @@ export default tseslint.config(
|
|
|
ignores: ['dist/', 'node_modules/'],
|
|
|
},
|
|
|
eslint.configs.recommended,
|
|
|
- tseslint.configs.recommended,
|
|
|
- reactHooks.configs.flat.recommended,
|
|
|
+ tseslint.configs.strictTypeChecked,
|
|
|
+ tseslint.configs.stylisticTypeChecked,
|
|
|
+ reactHooks.configs.flat['recommended-latest'],
|
|
|
+ importX.flatConfigs.recommended,
|
|
|
+ importX.flatConfigs.typescript,
|
|
|
+ {
|
|
|
+ settings: {
|
|
|
+ 'import-x/resolver-next': [createTypeScriptImportResolver()],
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
files: ['src/**/*.{ts,tsx}'],
|
|
|
plugins: {
|
|
|
react,
|
|
|
},
|
|
|
rules: {
|
|
|
- ...eslint.configs.recommended.rules,
|
|
|
- ...tseslint.configs.recommended.rules,
|
|
|
...react.configs.recommended.rules,
|
|
|
...react.configs['jsx-runtime'].rules,
|
|
|
+ '@typescript-eslint/consistent-type-imports': 'error',
|
|
|
},
|
|
|
languageOptions: {
|
|
|
globals: globals.browser,
|
|
|
parserOptions: {
|
|
|
+ projectService: true,
|
|
|
ecmaFeatures: {
|
|
|
jsx: true,
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
settings: {
|
|
|
react: {
|
|
|
version: 'detect',
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ files: ['src/**/*.spec.{ts,tsx}'],
|
|
|
+ plugins: {
|
|
|
+ ...jest.configs['flat/recommended'].plugins,
|
|
|
+ ...jest.configs['flat/style'].plugins,
|
|
|
+ ...testingLibrary.configs['flat/react'].plugins,
|
|
|
+ },
|
|
|
+ languageOptions: {
|
|
|
+ ...jest.configs['flat/recommended'].languageOptions,
|
|
|
+ ...jest.configs['flat/style'].languageOptions,
|
|
|
+ globals: {
|
|
|
+ ...jest.configs['flat/recommended'].languageOptions?.globals,
|
|
|
+ ...globals.node,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ ...jest.configs['flat/recommended'].rules,
|
|
|
+ ...jest.configs['flat/style'].rules,
|
|
|
+ ...testingLibrary.configs['flat/react'].rules,
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
files: ['integration-tests/**/*.{ts,tsx,js}'],
|
|
|
+ ...tseslint.configs.disableTypeChecked,
|
|
|
...cypress.configs.recommended,
|
|
|
languageOptions: {
|
|
|
globals: {
|
|
|
@@ -48,6 +82,7 @@ export default tseslint.config(
|
|
|
},
|
|
|
},
|
|
|
rules: {
|
|
|
+ ...tseslint.configs.disableTypeChecked.rules,
|
|
|
...cypress.configs.recommended.rules,
|
|
|
'no-console': 'off',
|
|
|
'@typescript-eslint/no-namespace': 'off',
|