-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.js
119 lines (118 loc) · 2.92 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
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
// BASIC ESLINT RULES
//'array-bracket-spacing': ['error', 'never'], May enforce this in the future
'arrow-parens': 'error',
'arrow-spacing': 'error',
'brace-style': ['error', '1tbs', {
'allowSingleLine': false
}],
'camelcase': ['error', {
'properties': 'never'
}],
'comma-dangle': ['error', 'never'],
'comma-spacing': ['error'],
'comma-style': ['error', 'last'],
'curly': ['error', 'all'],
'dot-notation': 'error',
'dot-location': ['error', 'property'],
'generator-star-spacing': ['error', {'before': false, 'after': true}],
'indent': ['error', 2, {
'SwitchCase': 1
}],
'key-spacing': ['error', {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': 'error',
'max-statements-per-line': ['error', { 'max': 1 }],
'new-cap': ['error', {
// Capital variables that can be used without `new`
'capIsNewExceptions': [
'A' // Ember.A
]
}],
'no-const-assign': 'error',
'no-duplicate-imports': 'error',
'no-empty': 'error',
'no-multiple-empty-lines': 'error',
'no-multi-spaces': 'error',
'no-nested-ternary': 'error',
'no-spaced-func': 'error',
'no-trailing-spaces': 'error',
'no-unneeded-ternary': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-var': 'error',
'object-curly-spacing': ['error', 'always'],
'object-shorthand': 'error',
'one-var': ['error', {
'uninitialized': 'always',
'initialized': 'never'
}],
'operator-linebreak': ['error', 'after'],
'prefer-const': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'quotes': ['error', 'single', {
'avoidEscape': true
}],
'radix': ['error', 'always'],
'rest-spread-spacing': ["error"],
'semi': ['error', 'always'],
'semi-spacing': ['error', {
'before': false,
'after': true
}],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', {
'words': false,
'nonwords': false
}],
'spaced-comment': ['error', 'always']
},
overrides: [
// node files
{
files: [
'testem.js',
'ember-cli-build.js',
'config/**/*.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
},
// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
}
]
};