-
Notifications
You must be signed in to change notification settings - Fork 26
/
.eslintrc.js
96 lines (91 loc) · 2.41 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},
env: {
es6: true,
},
extends: ['eslint:recommended'],
plugins: ['@typescript-eslint', '@glimmerx'],
rules: {
'@glimmerx/template-vars': 'error',
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.babelrc.js',
'standalone.js',
'**/testem.js',
'**/config/ember-try.js',
'**/config/environment.js',
'**/config/targets.js',
'**/ember-cli-build.js',
'**/ember-addon-main.js',
'**/bin/**/*.js',
'**/scripts/**/*.js',
'**/blueprints/**/*.js',
'**/compiler/**/*.js',
'webpack.config.js',
'packages/@glimmerx/blueprint/index.js',
],
env: {
es6: true,
node: true,
},
},
{
files: [
'packages/@glimmerx/babel-preset/**/*.js',
'packages/@glimmerx/eslint-plugin/**/*.js',
'packages/@glimmerx/prettier-plugin-component-templates/**/*.js',
'packages/@glimmerx/webpack-loader/**/*.js',
],
env: {
es6: true,
node: true,
mocha: true,
},
},
// bin scripts
{
files: ['bin/**/*.js'],
rules: {
'no-process-exit': 'off',
},
},
// TypeScript source
{
files: ['**/*.ts'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/ban-types': [
'error',
{
types: {
// we currently use `object` as "valid WeakMap key" in a lot of APIs
object: false,
},
},
],
// We should try to remove this eventually
'@typescript-eslint/explicit-function-return-type': 'off',
// We should also try to remove this eventually
'@typescript-eslint/ban-ts-ignore': 'off',
// disabling this one because of DEBUG APIs, if we ever find a better
// way to suport those we should re-enable it
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
},
},
],
};