|
1 | 1 | const path = require('path'); |
2 | 2 |
|
3 | 3 | module.exports = { |
4 | | - // Configuration for JavaScript files |
5 | | - extends: ['@react-native-community', 'plugin:prettier/recommended'], |
6 | | - plugins: ['unicorn'], |
| 4 | + extends: ['expo','plugin:tailwindcss/recommended', 'prettier'], |
| 5 | + plugins: [ |
| 6 | + 'unicorn', |
| 7 | + '@typescript-eslint', |
| 8 | + 'unused-imports', |
| 9 | + 'tailwindcss', |
| 10 | + 'simple-import-sort', |
| 11 | + ], |
| 12 | + parserOptions: { |
| 13 | + project: './tsconfig.json', |
| 14 | + }, |
7 | 15 | rules: { |
8 | | - 'prettier/prettier': [ |
| 16 | + 'unicorn/filename-case': [ |
9 | 17 | 'error', |
10 | 18 | { |
11 | | - singleQuote: true, |
12 | | - endOfLine: 'auto', |
| 19 | + case: 'kebabCase', |
| 20 | + ignore: ['/android', '/ios'], |
13 | 21 | }, |
14 | 22 | ], |
15 | | - 'unicorn/filename-case': [ |
| 23 | + 'max-params': ['error', 3], // Limit the number of parameters in a function to use object instead |
| 24 | + 'max-lines-per-function': ['error', 70], |
| 25 | + 'react/display-name': 'off', |
| 26 | + 'react/no-inline-styles': 'off', |
| 27 | + 'react/destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable |
| 28 | + 'react/require-default-props': 'off', // Allow non-defined react props as undefined |
| 29 | + '@typescript-eslint/comma-dangle': 'off', // Avoid conflict rule between Eslint and Prettier |
| 30 | + '@typescript-eslint/consistent-type-imports': 'error', // Ensure `import type` is used when it's necessary |
| 31 | + 'import/prefer-default-export': 'off', // Named export is easier to refactor automatically |
| 32 | + 'tailwindcss/classnames-order': [ |
| 33 | + 'warn', |
| 34 | + { |
| 35 | + officialSorting: true, |
| 36 | + }, |
| 37 | + ], // Follow the same ordering as the official plugin `prettier-plugin-tailwindcss` |
| 38 | + 'simple-import-sort/imports': 'error', // Import configuration for `eslint-plugin-simple-import-sort` |
| 39 | + 'simple-import-sort/exports': 'error', // Export configuration for `eslint-plugin-simple-import-sort` |
| 40 | + '@typescript-eslint/no-unused-vars': 'off', |
| 41 | + 'tailwindcss/no-custom-classname': 'off', |
| 42 | + 'unused-imports/no-unused-imports': 'error', |
| 43 | + 'unused-imports/no-unused-vars': [ |
16 | 44 | 'error', |
17 | 45 | { |
18 | | - case: 'kebabCase', |
19 | | - ignore: ['/android', '/ios'], |
| 46 | + argsIgnorePattern: '^_', |
| 47 | + varsIgnorePattern: '^_', |
| 48 | + caughtErrorsIgnorePattern: '^_', |
20 | 49 | }, |
21 | 50 | ], |
22 | 51 | }, |
23 | 52 | overrides: [ |
24 | | - // Configuration for TypeScript files |
25 | | - { |
26 | | - files: ['**/*.ts', '**/*.tsx', '**/*.js'], |
27 | | - plugins: [ |
28 | | - '@typescript-eslint', |
29 | | - 'unused-imports', |
30 | | - 'tailwindcss', |
31 | | - 'simple-import-sort', |
32 | | - ], |
33 | | - extends: [ |
34 | | - 'plugin:tailwindcss/recommended', |
35 | | - '@react-native-community', |
36 | | - 'plugin:prettier/recommended', |
37 | | - ], |
38 | | - parserOptions: { |
39 | | - project: './tsconfig.json', |
40 | | - }, |
41 | | - rules: { |
42 | | - 'prettier/prettier': [ |
43 | | - 'error', |
44 | | - { |
45 | | - singleQuote: true, |
46 | | - endOfLine: 'auto', |
47 | | - }, |
48 | | - ], |
49 | | - 'max-params': ['error', 3], // Limit the number of parameters in a function to use object instead |
50 | | - 'max-lines-per-function': ['error', 70], |
51 | | - 'react/destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable |
52 | | - 'react/require-default-props': 'off', // Allow non-defined react props as undefined |
53 | | - '@typescript-eslint/comma-dangle': 'off', // Avoid conflict rule between Eslint and Prettier |
54 | | - '@typescript-eslint/consistent-type-imports': 'error', // Ensure `import type` is used when it's necessary |
55 | | - 'import/prefer-default-export': 'off', // Named export is easier to refactor automatically |
56 | | - 'tailwindcss/classnames-order': [ |
57 | | - 'warn', |
58 | | - { |
59 | | - officialSorting: true, |
60 | | - }, |
61 | | - ], // Follow the same ordering as the official plugin `prettier-plugin-tailwindcss` |
62 | | - 'simple-import-sort/imports': 'error', // Import configuration for `eslint-plugin-simple-import-sort` |
63 | | - 'simple-import-sort/exports': 'error', // Export configuration for `eslint-plugin-simple-import-sort` |
64 | | - '@typescript-eslint/no-unused-vars': 'off', |
65 | | - 'tailwindcss/no-custom-classname': 'off', |
66 | | - 'unused-imports/no-unused-imports': 'error', |
67 | | - 'unused-imports/no-unused-vars': [ |
68 | | - 'error', |
69 | | - { |
70 | | - argsIgnorePattern: '^_', |
71 | | - varsIgnorePattern: '^_', |
72 | | - caughtErrorsIgnorePattern: '^_', |
73 | | - }, |
74 | | - ], |
75 | | - }, |
76 | | - }, |
77 | 53 | // Configuration for translations files (i18next) |
78 | 54 | { |
79 | 55 | files: ['src/translations/*.json'], |
|
0 commit comments