|
1 | 1 | module.exports = { |
2 | 2 | root: true, |
3 | 3 | extends: [ |
| 4 | + "eslint:recommended", |
| 5 | + "plugin:react/recommended", |
| 6 | + "plugin:@typescript-eslint/recommended", |
4 | 7 | "@react-native-community", |
5 | | - "airbnb-typescript", |
6 | 8 | "prettier", |
7 | | - "prettier/@typescript-eslint", |
8 | | - "prettier/react" |
9 | 9 | ], |
10 | | - parser: "babel-eslint", |
11 | | - plugins: ["react", "react-native"], |
| 10 | + ignorePatterns: [ |
| 11 | + "**/*/*.js", |
| 12 | + "*.js", |
| 13 | + "*.svg", |
| 14 | + "*.json", |
| 15 | + "*.png", |
| 16 | + "package.json", |
| 17 | + "package-lock.json", |
| 18 | + ], |
| 19 | + parser: "@typescript-eslint/parser", |
| 20 | + plugins: [ |
| 21 | + "import", |
| 22 | + "react", |
| 23 | + "react-native", |
| 24 | + "prettier", |
| 25 | + "react-hooks", |
| 26 | + "@typescript-eslint", |
| 27 | + "promise", |
| 28 | + "jest", |
| 29 | + "unused-imports", |
| 30 | + ], |
12 | 31 | env: { |
13 | | - jest: true, |
14 | | - "react-native/react-native": true |
| 32 | + browser: true, |
| 33 | + es2021: true, |
| 34 | + "jest/globals": true, |
| 35 | + "react-native/react-native": true, |
| 36 | + }, |
| 37 | + settings: { |
| 38 | + "import/resolver": { |
| 39 | + node: { |
| 40 | + extensions: [ |
| 41 | + ".js", |
| 42 | + ".jsx", |
| 43 | + ".ts", |
| 44 | + ".tsx", |
| 45 | + ".d.ts", |
| 46 | + ".android.js", |
| 47 | + ".android.jsx", |
| 48 | + ".android.ts", |
| 49 | + ".android.tsx", |
| 50 | + ".ios.js", |
| 51 | + ".ios.jsx", |
| 52 | + ".ios.ts", |
| 53 | + ".ios.tsx", |
| 54 | + ".web.js", |
| 55 | + ".web.jsx", |
| 56 | + ".web.ts", |
| 57 | + ".web.tsx", |
| 58 | + ], |
| 59 | + }, |
| 60 | + }, |
15 | 61 | }, |
16 | 62 | rules: { |
17 | | - // allow js file extension |
18 | | - "react/jsx-filename-extension": [ |
| 63 | + quotes: [ |
19 | 64 | "error", |
| 65 | + "double", |
20 | 66 | { |
21 | | - extensions: [".js", ".jsx", ".tsx", ".ts"] |
22 | | - } |
| 67 | + avoidEscape: true, |
| 68 | + }, |
23 | 69 | ], |
24 | | - // for post defining style object in react-native |
25 | | - "no-use-before-define": ["error", { variables: false }], |
26 | | - // react-native rules |
| 70 | + "import/extensions": [ |
| 71 | + "error", |
| 72 | + "never", |
| 73 | + { |
| 74 | + svg: "always", |
| 75 | + model: "always", |
| 76 | + style: "always", |
| 77 | + png: "always", |
| 78 | + jpg: "always", |
| 79 | + json: "always", |
| 80 | + constant: "always", |
| 81 | + }, |
| 82 | + ], |
| 83 | + "no-useless-catch": 0, |
| 84 | + "react-hooks/exhaustive-deps": 0, |
| 85 | + "max-len": ["error", 120], |
| 86 | + "@typescript-eslint/ban-ts-comment": 1, |
| 87 | + "@typescript-eslint/no-empty-function": 0, |
| 88 | + "@typescript-eslint/no-explicit-any": 1, |
| 89 | + "@typescript-eslint/explicit-module-boundary-types": 0, |
| 90 | + "react/jsx-filename-extension": ["error", { extensions: [".tsx"] }], |
27 | 91 | "react-native/no-unused-styles": 2, |
28 | 92 | "react-native/split-platform-components": 2, |
29 | | - "react-native/no-inline-styles": 2, |
30 | | - "react-native/no-raw-text": 2 |
31 | | - } |
| 93 | + "react-native/no-inline-styles": 0, |
| 94 | + "react-native/no-color-literals": 0, |
| 95 | + "react-native/no-raw-text": 0, |
| 96 | + "import/no-extraneous-dependencies": 2, |
| 97 | + "import/no-named-as-default-member": 2, |
| 98 | + "import/order": 0, |
| 99 | + "import/no-duplicates": 2, |
| 100 | + "import/no-useless-path-segments": 2, |
| 101 | + "import/no-cycle": 2, |
| 102 | + "import/prefer-default-export": 0, |
| 103 | + "import/no-anonymous-default-export": 0, |
| 104 | + "import/named": 0, |
| 105 | + "@typescript-eslint/no-empty-interface": 0, |
| 106 | + "import/namespace": 0, |
| 107 | + "import/default": 0, |
| 108 | + "import/no-named-as-default": 0, |
| 109 | + "import/no-unused-modules": 0, |
| 110 | + "import/no-deprecated": 0, |
| 111 | + "@typescript-eslint/indent": 0, |
| 112 | + "react-hooks/rules-of-hooks": 2, |
| 113 | + camelcase: 2, |
| 114 | + "prefer-destructuring": 2, |
| 115 | + "no-nested-ternary": 2, |
| 116 | + "prettier/prettier": [ |
| 117 | + "error", |
| 118 | + { |
| 119 | + endOfLine: "auto", |
| 120 | + }, |
| 121 | + ], |
| 122 | + }, |
32 | 123 | }; |
0 commit comments