-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.eslintrc.js
94 lines (93 loc) · 2.31 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
82
83
84
85
86
87
88
89
90
91
92
93
94
const path = require('path-browserify');
module.exports = {
root: true,
extends: [
'@react-native-community',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
settings: {
react: { version: 'detect' },
'import/ignore': [
'node_modules/react-native/index\\.js$',
'node_modules/react-native-keychain',
],
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx', '.png'],
paths: ['.'],
},
typescript: {
project: path.resolve(__dirname, '.tsconfig.json'),
},
},
'@typescript-eslint/naming-convention': [
'warn',
{
selector: ['variable', 'function', 'parameter'],
format: ['camelCase'],
},
],
},
globals: {
__DEV__: true,
},
rules: {
curly: [2, 'multi-line'],
radix: ['error', 'as-needed'],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
},
],
'react/jsx-curly-brace-presence': ['error', 'never'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-shadow': ['error'],
// To be re-enabled
'import/no-named-as-default': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': 0,
'react-native/no-inline-styles': 0,
'react/no-unstable-nested-components': 0,
//
'import/no-named-as-default-member': 0,
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: false,
},
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
pathGroups: [
{
pattern: '@cardstack/**',
group: 'external',
position: 'after',
},
{
pattern: '@/**',
group: 'external',
position: 'after',
},
],
'newlines-between': 'always',
},
],
},
env: { browser: true, node: true, jest: true }, // browser needs to be true so it finds btoa and fetch polyfills
};