|
| 1 | +import eslint from '@eslint/js'; |
| 2 | +import tseslint from 'typescript-eslint'; |
| 3 | +import react from 'eslint-plugin-react'; |
| 4 | +import prettier from 'eslint-plugin-prettier/recommended'; |
| 5 | +import reactHooks from 'eslint-plugin-react-hooks'; |
| 6 | +import cypress from 'eslint-plugin-cypress'; |
| 7 | +import globals from 'globals'; |
| 8 | + |
| 9 | +export default tseslint.config( |
| 10 | + { |
| 11 | + ignores: ['dist/', 'node_modules/'], |
| 12 | + }, |
| 13 | + eslint.configs.recommended, |
| 14 | + tseslint.configs.recommended, |
| 15 | + reactHooks.configs.flat.recommended, |
| 16 | + { |
| 17 | + files: ['src/**/*.{ts,tsx}'], |
| 18 | + plugins: { |
| 19 | + react, |
| 20 | + }, |
| 21 | + rules: { |
| 22 | + ...eslint.configs.recommended.rules, |
| 23 | + ...tseslint.configs.recommended.rules, |
| 24 | + ...react.configs.recommended.rules, |
| 25 | + ...react.configs['jsx-runtime'].rules, |
| 26 | + }, |
| 27 | + languageOptions: { |
| 28 | + globals: globals.browser, |
| 29 | + parserOptions: { |
| 30 | + ecmaFeatures: { |
| 31 | + jsx: true, |
| 32 | + }, |
| 33 | + } |
| 34 | + }, |
| 35 | + settings: { |
| 36 | + react: { |
| 37 | + version: 'detect', |
| 38 | + }, |
| 39 | + } |
| 40 | + }, |
| 41 | + { |
| 42 | + files: ['integration-tests/**/*.{ts,tsx,js}'], |
| 43 | + ...cypress.configs.recommended, |
| 44 | + languageOptions: { |
| 45 | + globals: { |
| 46 | + require: 'readonly', |
| 47 | + module: 'writable', |
| 48 | + }, |
| 49 | + }, |
| 50 | + rules: { |
| 51 | + ...cypress.configs.recommended.rules, |
| 52 | + 'no-console': 'off', |
| 53 | + '@typescript-eslint/no-namespace': 'off', |
| 54 | + '@typescript-eslint/no-require-imports': 'off', |
| 55 | + '@typescript-eslint/no-unused-expressions': 'off', |
| 56 | + }, |
| 57 | + }, |
| 58 | + prettier, |
| 59 | +); |
0 commit comments