forked from CenterForOpenScience/ember-osf-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
106 lines (106 loc) · 3.15 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
module.exports = {
globals: {
server: true,
},
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
},
extends: '@centerforopenscience/eslint-config/ember',
plugins: [
'@typescript-eslint',
],
env: {
browser: true,
es6: true,
},
rules: {
'arrow-parens': ['error', 'as-needed'],
'class-methods-use-this': 'off',
'max-len': ['error', { code: 120 }],
strict: 'off',
'function-paren-newline': ['error', 'consistent'],
'prefer-rest-params': 'error',
'generator-star-spacing': ['error', 'before'],
'object-curly-newline': ['error', {
ObjectExpression: { multiline: true, consistent: true },
ObjectPattern: { multiline: true, consistent: true },
ImportDeclaration: { multiline: true, consistent: true },
ExportDeclaration: { multiline: true, consistent: true },
}],
'ember/named-functions-in-promises': 'off',
'ember/new-module-imports': 'error',
'ember/no-attrs-in-components': 'error',
'ember/no-old-shims': 'error',
'import/export': 'off',
'import/prefer-default-export': 'off',
'no-restricted-globals': 'off',
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
'no-underscore-dangle': 'off',
'linebreak-style': ['error', (process.platform === 'win32' ? 'windows' : 'unix')],
},
overrides: [
{
files: ['**/config/environment.d.ts'],
rules: {
indent: 'off',
'indent-legacy': 'error',
},
},
{
files: ['**/*.ts'],
rules: {
// Better enforced by TS
'no-undef': 'off',
'no-unused-vars': 'off',
'ember/no-attrs-snapshot': 'off',
},
},
{
files: ['**/*.d.ts'],
rules: {
'no-useless-constructor': 'off',
'space-infix-ops': 'off',
'no-shadow': 'off',
},
},
{
files: ['app/locales/*/translations.ts'],
rules: {
'max-len': 'off',
},
},
{
files: ['tests/**/*'],
rules: {
'no-await-in-loop': 'off',
'ember/avoid-leaking-state-in-components': 'off',
'ember/avoid-leaking-state-in-ember-objects': 'off',
},
},
{
files: ['mirage/**/*'],
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'off',
},
},
{
files: ['lib/*/index.js'],
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'off',
},
},
{
files: ['lib/*/addon/engine.js'],
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'off',
},
},
],
};