forked from mainmatter/ember-promise-modals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
135 lines (127 loc) · 3.87 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
'use strict';
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
},
ecmaVersion: 2018,
ecmaFeatures: {
legacyDecorators: true,
},
requireConfigFile: false,
sourceType: 'module',
},
plugins: ['ember', 'prettier', 'promise', 'import-helpers'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
env: {
browser: true,
},
rules: {
'require-yield': 'off',
// Possible Errors
'no-async-promise-executor': 'error',
'no-template-curly-in-string': 'error',
'require-atomic-updates': 'error',
// Best Practices
'array-callback-return': 'error',
eqeqeq: 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-implicit-coercion': 'error',
'no-implied-eval': 'error',
'no-lone-blocks': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-return-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-with': 'error',
'prefer-promise-reject-errors': 'error',
radix: 'error',
'wrap-iife': 'error',
yoda: 'error',
// ECMAScript 6
'no-duplicate-imports': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'error',
'no-useless-rename': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-numeric-literals': 'error',
'prettier/prettier': 'error',
'promise/catch-or-return': 'error',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/no-nesting': 'error',
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'error',
'promise/valid-params': 'error',
'import-helpers/order-imports': [
'error',
{
newlinesBetween: 'always',
groups: [
'/^(assert|async_hooks|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|http2|https|inspector|module|net|os|path|perf_hooks|process|punycode|querystring|readline|repl|stream|string_decoder|timers|tls|trace_events|tty|url|util|v8|vm|zli)/',
// Testing modules
['/^qunit/', '/^ember-qunit/', '/^@ember/test-helpers/', '/^ember-exam/'],
// Ember.js modules
['/^ember$/', '/^@ember/', '/^ember-data/'],
['module'],
[`/^${require('./package.json').name}\\//`],
['parent', 'sibling', 'index'],
],
alphabetize: { order: 'asc', ignoreCase: true },
},
],
// Legacy Ember
'ember/no-actions-hash': 'off',
'ember/no-assignment-of-untracked-properties-used-in-tracking-contexts': 'off',
'ember/no-classic-classes': 'off',
'ember/no-classic-components': 'off',
'ember/no-component-lifecycle-hooks': 'off',
'ember/require-tagless-components': 'off',
},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.release-it.js',
'./.template-lintrc.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};