Skip to content

Commit 9a9f734

Browse files
committedSep 23, 2022
feat(eslint): add eslint
1 parent f8bbcbc commit 9a9f734

File tree

111 files changed

+3803
-2002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3803
-2002
lines changed
 

‎.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib
2+
.eslintrc.js
3+
babel.config.js
4+
metro.config.js

‎.eslintrc.js

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
project: "./tsconfig.json",
6+
tsconfigRootDir: "./",
7+
},
8+
extends: [
9+
"airbnb",
10+
"@react-native-community",
11+
"prettier",
12+
"plugin:@typescript-eslint/eslint-recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:import/typescript",
15+
"plugin:jest/recommended",
16+
],
17+
plugins: ["@typescript-eslint", "prettier", "import"],
18+
rules: {
19+
complexity: ["error", 8],
20+
"import/order": "off",
21+
"import/extensions": 0,
22+
"react/jsx-filename-extension": [
23+
2,
24+
{
25+
extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
26+
},
27+
],
28+
"import/no-unresolved": [
29+
2,
30+
{
31+
"ignore": ["@env"]
32+
}
33+
],
34+
"arrow-body-style": 0,
35+
"import/prefer-default-export": 0,
36+
"eslint-comments/no-unlimited-disable": 0,
37+
"@typescript-eslint/no-unused-vars": [
38+
"error",
39+
{
40+
argsIgnorePattern: "_",
41+
varsIgnorePattern: "_",
42+
},
43+
],
44+
"react/jsx-key": [
45+
"error",
46+
{
47+
checkFragmentShorthand: true,
48+
},
49+
],
50+
"@typescript-eslint/ban-types": [
51+
"error",
52+
{
53+
types: {
54+
object: false,
55+
Function: false,
56+
"{}": false,
57+
},
58+
extendDefaults: true,
59+
},
60+
],
61+
"jsx-a11y/anchor-is-valid": 0,
62+
"@typescript-eslint/ban-ts-comment": [
63+
"error",
64+
{ "ts-ignore": "allow-with-description" },
65+
],
66+
"class-methods-use-this": 0,
67+
"import/no-cycle": 0,
68+
"no-shadow": "off",
69+
"@typescript-eslint/no-shadow": ["error"],
70+
"no-param-reassign": [2, { props: false }],
71+
"react/require-default-props": "off",
72+
"react/no-unused-prop-types": 0,
73+
"import/no-extraneous-dependencies": 0
74+
},
75+
"settings": {
76+
"import/parsers": {
77+
"@typescript-eslint/parser": [".ts", ".tsx"]
78+
},
79+
"import/resolver": {
80+
"typescript": {
81+
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
82+
83+
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
84+
85+
// use <root>/path/to/folder/tsconfig.json
86+
"project": "./",
87+
}
88+
}
89+
}
90+
};

0 commit comments

Comments
 (0)