|
1 | | -const path = require('path'); |
2 | | - |
3 | 1 | module.exports = { |
4 | | - extends: ['expo', 'plugin:tailwindcss/recommended', 'prettier'], |
5 | | - plugins: ['prettier', 'unicorn', '@typescript-eslint', 'unused-imports', 'tailwindcss', 'simple-import-sort', 'eslint-plugin-react-compiler'], |
| 2 | + extends: ['prettier'], |
| 3 | + plugins: ['prettier', '@typescript-eslint', 'react', 'react-hooks', 'simple-import-sort'], |
| 4 | + parser: '@typescript-eslint/parser', |
6 | 5 | parserOptions: { |
7 | | - project: './tsconfig.json', |
| 6 | + ecmaFeatures: { |
| 7 | + jsx: true, |
| 8 | + }, |
| 9 | + ecmaVersion: 'latest', |
| 10 | + sourceType: 'module', |
| 11 | + }, |
| 12 | + settings: { |
| 13 | + react: { |
| 14 | + version: 'detect', |
| 15 | + }, |
8 | 16 | }, |
9 | 17 | rules: { |
10 | 18 | 'prettier/prettier': 'warn', |
11 | | - 'max-params': ['error', 10], // Limit the number of parameters in a function to use object instead |
| 19 | + 'max-params': ['error', 10], |
12 | 20 | 'max-lines-per-function': ['error', 1500], |
13 | 21 | 'react/display-name': 'off', |
14 | 22 | 'react/no-inline-styles': 'off', |
15 | | - 'react/destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable |
16 | | - 'react/require-default-props': 'off', // Allow non-defined react props as undefined |
17 | | - '@typescript-eslint/comma-dangle': 'off', // Avoid conflict rule between Eslint and Prettier |
| 23 | + 'react/destructuring-assignment': 'off', |
| 24 | + 'react/require-default-props': 'off', |
| 25 | + 'react/react-in-jsx-scope': 'off', |
| 26 | + 'react/no-unstable-nested-components': ['warn', { allowAsProps: true }], |
| 27 | + 'react-hooks/rules-of-hooks': 'error', |
| 28 | + 'react-hooks/exhaustive-deps': 'warn', |
| 29 | + '@typescript-eslint/comma-dangle': 'off', |
18 | 30 | '@typescript-eslint/consistent-type-imports': [ |
19 | 31 | 'warn', |
20 | 32 | { |
21 | 33 | prefer: 'type-imports', |
22 | 34 | fixStyle: 'inline-type-imports', |
23 | 35 | disallowTypeAnnotations: true, |
24 | 36 | }, |
25 | | - ], // Ensure `import type` is used when it's necessary |
26 | | - 'import/prefer-default-export': 'off', // Named export is easier to refactor automatically |
27 | | - 'import/no-cycle': ['error', { maxDepth: '∞' }], |
28 | | - 'tailwindcss/classnames-order': [ |
29 | | - 'warn', |
30 | | - { |
31 | | - officialSorting: true, |
32 | | - }, |
33 | | - ], // Follow the same ordering as the official plugin `prettier-plugin-tailwindcss` |
34 | | - 'simple-import-sort/imports': 'error', // Import configuration for `eslint-plugin-simple-import-sort` |
35 | | - 'simple-import-sort/exports': 'error', // Export configuration for `eslint-plugin-simple-import-sort` |
36 | | - '@typescript-eslint/no-unused-vars': 'off', |
37 | | - 'tailwindcss/no-custom-classname': 'off', |
38 | | - 'unused-imports/no-unused-imports': 'off', |
39 | | - 'unused-imports/no-unused-vars': [ |
40 | | - 'off', |
41 | | - { |
42 | | - argsIgnorePattern: '^_', |
43 | | - varsIgnorePattern: '^_', |
44 | | - caughtErrorsIgnorePattern: '^_', |
45 | | - }, |
46 | 37 | ], |
| 38 | + 'simple-import-sort/imports': 'error', |
| 39 | + 'simple-import-sort/exports': 'error', |
| 40 | + '@typescript-eslint/no-unused-vars': 'off', |
47 | 41 | }, |
48 | | - overrides: [ |
49 | | - // Configuration for translations files (i18next) |
50 | | - { |
51 | | - files: ['src/translations/*.json'], |
52 | | - extends: ['plugin:i18n-json/recommended'], |
53 | | - rules: { |
54 | | - 'i18n-json/valid-message-syntax': [ |
55 | | - 2, |
56 | | - { |
57 | | - syntax: path.resolve('./scripts/i18next-syntax-validation.js'), |
58 | | - }, |
59 | | - ], |
60 | | - 'i18n-json/valid-json': 2, |
61 | | - 'i18n-json/sorted-keys': [ |
62 | | - 2, |
63 | | - { |
64 | | - order: 'asc', |
65 | | - indentSpaces: 2, |
66 | | - }, |
67 | | - ], |
68 | | - 'i18n-json/identical-keys': [ |
69 | | - 2, |
70 | | - { |
71 | | - filePath: path.resolve('./src/translations/en.json'), |
72 | | - }, |
73 | | - ], |
74 | | - 'prettier/prettier': [ |
75 | | - 0, |
76 | | - { |
77 | | - singleQuote: true, |
78 | | - endOfLine: 'auto', |
79 | | - }, |
80 | | - ], |
81 | | - }, |
82 | | - }, |
83 | | - { |
84 | | - // Configuration for testing files |
85 | | - files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], |
86 | | - extends: ['plugin:testing-library/react'], |
87 | | - }, |
88 | | - ], |
89 | 42 | }; |
0 commit comments