|
| 1 | +{ |
| 2 | + // Configuration for JavaScript files |
| 3 | + "extends": ["airbnb-base", "plugin:prettier/recommended"], |
| 4 | + "rules": { |
| 5 | + "prettier/prettier": [ |
| 6 | + "error", |
| 7 | + { |
| 8 | + "singleQuote": true, |
| 9 | + "endOfLine": "auto" |
| 10 | + } |
| 11 | + ] |
| 12 | + }, |
| 13 | + "overrides": [ |
| 14 | + // Configuration for TypeScript files |
| 15 | + { |
| 16 | + "files": ["**/*.ts", "**/*.tsx"], |
| 17 | + "plugins": [ |
| 18 | + "@typescript-eslint", |
| 19 | + "unused-imports", |
| 20 | + "tailwindcss", |
| 21 | + "simple-import-sort" |
| 22 | + ], |
| 23 | + "extends": [ |
| 24 | + "plugin:tailwindcss/recommended", |
| 25 | + "airbnb", |
| 26 | + "airbnb-typescript", |
| 27 | + "airbnb/hooks", |
| 28 | + "plugin:react/jsx-runtime", |
| 29 | + "plugin:prettier/recommended" |
| 30 | + ], |
| 31 | + "parserOptions": { |
| 32 | + "project": "./tsconfig.json" |
| 33 | + }, |
| 34 | + "rules": { |
| 35 | + "prettier/prettier": [ |
| 36 | + "error", |
| 37 | + { |
| 38 | + "singleQuote": true, |
| 39 | + "endOfLine": "auto" |
| 40 | + } |
| 41 | + ], |
| 42 | + "import/extensions": [ |
| 43 | + "error", |
| 44 | + "ignorePackages", |
| 45 | + { |
| 46 | + "js": "never", |
| 47 | + "jsx": "never", |
| 48 | + "ts": "never", |
| 49 | + "tsx": "never", |
| 50 | + "": "never" |
| 51 | + } |
| 52 | + ], // Avoid missing file extension errors when using '@/' alias |
| 53 | + "react/function-component-definition": "off", // Disable Airbnb's specific function type |
| 54 | + "react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable |
| 55 | + "react/require-default-props": "off", // Allow non-defined react props as undefined |
| 56 | + "react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form |
| 57 | + "@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier |
| 58 | + "@typescript-eslint/consistent-type-imports": "error", // Ensure `import type` is used when it's necessary |
| 59 | + "no-restricted-syntax": [ |
| 60 | + "error", |
| 61 | + "ForInStatement", |
| 62 | + "LabeledStatement", |
| 63 | + "WithStatement" |
| 64 | + ], // Overrides Airbnb configuration and enable no-restricted-syntax |
| 65 | + "import/prefer-default-export": "off", // Named export is easier to refactor automatically |
| 66 | + "simple-import-sort/imports": "error", // Import configuration for `eslint-plugin-simple-import-sort` |
| 67 | + "simple-import-sort/exports": "error", // Export configuration for `eslint-plugin-simple-import-sort` |
| 68 | + "@typescript-eslint/no-unused-vars": "off", |
| 69 | + "unused-imports/no-unused-imports": "error", |
| 70 | + "unused-imports/no-unused-vars": [ |
| 71 | + "error", |
| 72 | + { "argsIgnorePattern": "^_" } |
| 73 | + ] |
| 74 | + } |
| 75 | + }, |
| 76 | + // Configuration for testing |
| 77 | + { |
| 78 | + "files": ["**/*.test.ts", "**/*.test.tsx"], |
| 79 | + "plugins": ["jest", "jest-formatting", "testing-library"], |
| 80 | + "extends": [ |
| 81 | + "plugin:jest/recommended", |
| 82 | + "plugin:jest-formatting/recommended", |
| 83 | + "plugin:testing-library/react" |
| 84 | + ] |
| 85 | + }, |
| 86 | + // Configuration for e2e testing |
| 87 | + { |
| 88 | + "files": ["e2e/**/*.ts"], |
| 89 | + "plugins": ["jest", "jest-formatting", "detox"], |
| 90 | + "extends": [ |
| 91 | + "plugin:jest/recommended", |
| 92 | + "plugin:jest-formatting/recommended" |
| 93 | + ], |
| 94 | + "parserOptions": { |
| 95 | + "project": "./e2e/tsconfig.json" |
| 96 | + }, |
| 97 | + "rules": { |
| 98 | + "import/no-extraneous-dependencies": [ |
| 99 | + "error", |
| 100 | + { |
| 101 | + "devDependencies": true |
| 102 | + } |
| 103 | + ] |
| 104 | + } |
| 105 | + } |
| 106 | + ] |
| 107 | +} |
0 commit comments