-
Notifications
You must be signed in to change notification settings - Fork 82
/
.eslintrc.js
107 lines (104 loc) · 3.2 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',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {
// Type overloads cause false positives. typescript errors on duplicates, so
// this doesn't need to be replaced.
'no-dupe-class-members': 'off',
// typescript handles this direclty, and the eslint rule doesn't understand
// how to resolve type-only imports when there is only a d.ts file and not a
// .js file.
'node/no-missing-import': 'off',
semi: 'off',
'@typescript-eslint/semi': ['error'],
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/naming-convention': 'off',
indent: 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['error'],
'@typescript-eslint/triple-slash-reference': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-for-in-array': 'error',
},
overrides: [
{
// node files
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/**/*.js',
'./script/**/*.js',
'./tests/dummy/config/**/*.js',
],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts,gjs}'],
extends: ['plugin:qunit/recommended'],
},
{
// JS files
files: ['tests/**/*.{js,gjs}'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
],
};