forked from nasa/earthdata-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
135 lines (113 loc) · 2.89 KB
/
.eslintrc
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
// Let eslint know were working as a browser to allow the standard globals (document, window, etc.)
"env": {
"browser": true,
"node": true,
"jest": true,
"cypress/globals": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"requireConfigFile": false
}
},
"plugins": [
"react",
"cypress"
],
"rules": {
// Setting a max line-length
"max-len": [1, 100, 2, {
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}],
// Disallow all semicolons on line endings
"semi": ["error", "never"],
// Allow both .js and .jsx extensions
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
// Allow shadow declarations
"no-shadow": "off",
// Disallow dangling commas
"comma-dangle": ["error", "never"],
// Require spacing in object literals
"object-curly-spacing": ["error", "always"],
// Allow class methods that dont use 'this'
"class-methods-use-this": "off",
// Allow console log messages
"no-console": "off",
// Allow extranious dependencies
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
// Allow named default exports
"import/no-named-as-default": "off",
// Allow files with no default export
"import/prefer-default-export": "off",
// Disable the depricated label-has-for rule
"jsx-a11y/label-has-for": "off",
// Use the correct version of this rule, rather than label-has-for
"jsx-a11y/label-has-associated-control": [
2,
{
"labelComponents": [
"label"
],
"labelAttributes": [
"htmlFor"
],
"controlComponents": [
"input"
]
}
],
// Allowing cyclic dependancies
"import/no-cycle": "off",
"react/jsx-props-no-spreading": ["error", {
"custom": "ignore"
}],
"react/prop-types": ["error", {
"skipUndeclared": true
}],
// Allow parentheses parameters on new lines, with 'consistent' config
"function-paren-newline": ["error", "consistent"],
// Named components should be arrow functions
"react/function-component-definition": "off",
"react/display-name": "off",
"react/no-unstable-nested-components": [
"warn",
{ "allowAsProps": true }
]
},
"overrides": [
{
"files": [
"*.test.js"
],
"rules": {
"import/first": 0
}
},
{
"files": [
"serverless/src/**/*"
],
"rules": {
"import/prefer-default-export": 0
}
}
],
// Use AirBnb settings as a base
"extends": [
"airbnb",
"plugin:react/recommended",
"plugin:cypress/recommended"
],
// Define version settings
"settings": {
"react": {
"pragma": "React",
"version": "16.12.0"
}
}
}