-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.js
107 lines (102 loc) · 2.38 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
"use-strict";
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
},
plugins: ["ember", "@typescript-eslint", "import"],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:prettier/recommended",
],
env: {
browser: true,
},
rules: {
// possible errors
"no-await-in-loop": "error",
// best practices
"array-callback-return": "error",
"dot-notation": "error",
eqeqeq: "error",
"no-alert": "error",
"no-else-return": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-floating-decimal": "error",
"one-var": ["error", "never"],
curly: ["error", "multi-line"],
// ES6
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-destructuring": [
"error",
{ AssignmentExpression: { array: false, object: false } },
],
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
// import
"import/no-duplicates": "error",
"import/no-unresolved": "off",
"import/order": [
"error",
{
"newlines-between": "always",
alphabetize: { order: "asc", caseInsensitive: true },
},
],
// tooling
"no-console": ["error", { allow: ["warn", "error"] }],
"no-debugger": "error",
},
overrides: [
// js files
{
files: ["**/*.js"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {},
},
// ts files
{
files: ["**/*.ts"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {},
},
// node files
{
files: [
"./.eslintrc.js",
"./.prettierrc.js",
"./.stylelintrc.js",
"./.template-lintrc.js",
"./ember-cli-build.js",
"./testem.js",
"./blueprints/*/index.js",
"./config/**/*.js",
"./lib/*/index.js",
"./server/**/*.js",
],
env: {
browser: false,
node: true,
},
extends: ["plugin:n/recommended"],
},
{
// test files
files: ["tests/**/*-test.{js,ts}"],
extends: ["plugin:qunit/recommended"],
},
],
};