|
1 | 1 | module.exports = {
|
2 | 2 | root: true,
|
3 |
| - extends: [ |
4 |
| - "@react-native-community", |
5 |
| - "airbnb-typescript", |
6 |
| - "prettier", |
7 |
| - "prettier/@typescript-eslint", |
8 |
| - "prettier/react" |
9 |
| - ], |
10 |
| - parser: "babel-eslint", |
11 |
| - plugins: ["react", "react-native"], |
12 |
| - env: { |
13 |
| - jest: true, |
14 |
| - "react-native/react-native": true |
| 3 | + extends: "@react-native-community", |
| 4 | + parser: "@typescript-eslint/parser", |
| 5 | + plugins: ["import", "eslint-plugin-import", "@typescript-eslint"], |
| 6 | + settings: { |
| 7 | + "import/resolver": { |
| 8 | + node: { |
| 9 | + extensions: [ |
| 10 | + ".js", |
| 11 | + ".jsx", |
| 12 | + ".ts", |
| 13 | + ".tsx", |
| 14 | + ".d.ts", |
| 15 | + ".android.js", |
| 16 | + ".android.jsx", |
| 17 | + ".android.ts", |
| 18 | + ".android.tsx", |
| 19 | + ".ios.js", |
| 20 | + ".ios.jsx", |
| 21 | + ".ios.ts", |
| 22 | + ".ios.tsx", |
| 23 | + ".web.js", |
| 24 | + ".web.jsx", |
| 25 | + ".web.ts", |
| 26 | + ".web.tsx", |
| 27 | + ], |
| 28 | + }, |
| 29 | + }, |
15 | 30 | },
|
16 | 31 | rules: {
|
17 |
| - // allow js file extension |
18 |
| - "react/jsx-filename-extension": [ |
| 32 | + quotes: [ |
19 | 33 | "error",
|
| 34 | + "double", |
20 | 35 | {
|
21 |
| - extensions: [".js", ".jsx", ".tsx", ".ts"] |
22 |
| - } |
| 36 | + avoidEscape: true, |
| 37 | + }, |
23 | 38 | ],
|
24 |
| - // for post defining style object in react-native |
25 |
| - "no-use-before-define": ["error", { variables: false }], |
26 |
| - // react-native rules |
| 39 | + "max-len": ["error", 120], |
| 40 | + "@typescript-eslint/ban-ts-comment": 2, |
| 41 | + "@typescript-eslint/no-explicit-any": 2, |
| 42 | + "@typescript-eslint/explicit-module-boundary-types": 0, |
| 43 | + "react/jsx-filename-extension": ["error", { extensions: [".tsx"] }], |
27 | 44 | "react-native/no-unused-styles": 2,
|
28 | 45 | "react-native/split-platform-components": 2,
|
29 |
| - "react-native/no-inline-styles": 2, |
30 |
| - "react-native/no-raw-text": 2 |
31 |
| - } |
| 46 | + "react-native/no-inline-styles": 0, |
| 47 | + "react-native/no-color-literals": 0, |
| 48 | + "react-native/no-raw-text": 0, |
| 49 | + "import/no-extraneous-dependencies": 2, |
| 50 | + "import/extensions": ["error", "never", { svg: "always" }], |
| 51 | + "import/no-named-as-default-member": 2, |
| 52 | + "import/order": ["error", { "newlines-between": "always" }], |
| 53 | + "import/no-duplicates": 2, |
| 54 | + "import/no-useless-path-segments": 2, |
| 55 | + "import/no-cycle": 2, |
| 56 | + "import/prefer-default-export": 0, |
| 57 | + "import/no-anonymous-default-export": 0, |
| 58 | + "import/named": 0, |
| 59 | + "@typescript-eslint/no-empty-interface": 0, |
| 60 | + "import/namespace": 0, |
| 61 | + "import/default": 0, |
| 62 | + "import/no-named-as-default": 0, |
| 63 | + "import/no-unused-modules": 0, |
| 64 | + "import/no-deprecated": 0, |
| 65 | + "@typescript-eslint/indent": 0, |
| 66 | + "react-hooks/rules-of-hooks": 2, |
| 67 | + "react-hooks/exhaustive-deps": [ |
| 68 | + "error", |
| 69 | + { additionalHooks: "(useMemoOne)" }, |
| 70 | + ], |
| 71 | + "jest/no-identical-title": 2, |
| 72 | + "jest/valid-expect": 2, |
| 73 | + camelcase: 2, |
| 74 | + "prefer-destructuring": 2, |
| 75 | + "no-nested-ternary": 2, |
| 76 | + }, |
32 | 77 | };
|
0 commit comments