forked from Expensify/react-native-onyx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
81 lines (81 loc) · 3.41 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module.exports = {
extends: ['expensify', 'prettier'],
parser: '@typescript-eslint/parser',
env: {
jest: true,
},
overrides: [
{
files: ['*.js', '*.jsx'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.website.js', '.desktop.js', '.native.js', '.ios.js', '.android.js', '.config.js', '.ts', '.tsx'],
},
},
},
rules: {
// Overwriting this for now because web-e will conflict with this
'react/jsx-filename-extension': [1, {extensions: ['.js']}],
'rulesdir/no-multiple-onyx-in-file': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
},
{
files: ['*.ts', '*.tsx'],
extends: ['expensify', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/stylistic', 'plugin:import/typescript', 'prettier', 'plugin:prettier/recommended'],
plugins: ['react', 'react-native', 'import', '@typescript-eslint'],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'rulesdir/prefer-underscore-method': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'react/jsx-filename-extension': ['error', {extensions: ['.tsx', '.jsx']}],
'import/no-unresolved': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
'@typescript-eslint/consistent-type-imports': ['error', {prefer: 'type-imports'}],
'@typescript-eslint/consistent-type-exports': ['error', {fixMixedExportsWithInlineTypeSpecifier: false}],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/array-type': ['error', {default: 'array-simple'}],
'@typescript-eslint/consistent-type-definitions': 'off',
'rulesdir/no-multiple-onyx-in-file': 'off',
'valid-jsdoc': 'off',
'rulesdir/prefer-import-module-contents': 'off',
'es/no-optional-chaining': 'off',
'es/no-nullish-coalescing-operators': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
},
{
files: ['tests/**/*.{js,jsx,ts,tsx}'],
rules: {
'@lwc/lwc/no-async-await': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
},
},
],
};