This repository has been archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.js
146 lines (139 loc) · 3.19 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
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
136
137
138
139
140
141
142
143
144
145
146
const {
DEFAULT_IGNORED_PROPERTIES
} = require('eslint-plugin-ember/lib/rules/avoid-leaking-state-in-ember-objects');
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'airbnb-base',
'plugin:ember/recommended'
],
env: {
es6: true,
browser: true
},
globals: {
$script: true,
Ember: true,
FastBoot: true,
Hammer: true,
M: true,
VisitSource: true,
Wikia: true
},
rules: {
/*
It is common in Ember world to do
this._super(...arguments);
therefore we can't enable prefer-rest-params and no-underscore-dangle
*/
"prefer-rest-params": 0,
"no-underscore-dangle": 0,
/*
This certainly helps with debugging but would make code very verbose now
I think this should be enabled when ember-decorators or ember-typescript is used
*/
"func-names": 0,
/*
in Ember world there are some wrapper packages that would violate this rule
e.g. you install ember-sinon but you can import it via sinon name
*/
"import/no-extraneous-dependencies": 0,
/*
not all imports that we have, fully map to the folder structure
biggest offenders are tests that do use absolute paths to a module that is being tested
*/
"import/no-unresolved": 0,
"no-param-reassign": 0,
/*
Destructurring arrays adds .5kb per module
We should enable it when we drop support for ios 9
as ios10 supports param destructuring
*/
"prefer-destructuring": 0,
"ember/avoid-leaking-state-in-ember-objects": [2, [
...DEFAULT_IGNORED_PROPERTIES,
'gestures',
]],
"ember/no-jquery": 2,
"ember/order-in-components": 2,
"ember/order-in-controllers": 2,
"ember/order-in-routes": 2,
"ember/no-side-effects": 1,
"no-plusplus": [
2,
{ "allowForLoopAfterthoughts": true },
],
},
overrides: [
// node files
{
files: [
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'ember-cli-build.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
},
// inline scripts files
{
files: [
'vendor/**/*.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 5
},
env: {
browser: true,
},
rules: {
"no-console": 0,
"no-var": 0,
"object-shorthand": 0,
"prefer-arrow-callback": 0,
"prefer-template": 0,
"vars-on-top": 0,
"no-empty": 0,
"no-inner-declarations": 0,
"comma-dangle": 0,
}
},
// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
},
rules: {
"import/newline-after-import": 0,
"no-restricted-globals": 0
}
},
{
files: ['**/mirage/fixtures/*.js'],
rules: {
"no-useless-escape": 0
}
}
]
};