This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy path.eslintrc.js
99 lines (94 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier'],
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',
'webpack.config.js',
'packages/@glimmer/babel-preset/**/*.js',
'packages/@glimmer/blueprint/index.js',
'**/babel-plugins.js'
],
env: {
es6: true,
node: true,
},
},
{
files: [
'packages/babel-plugins/**/test/**/*.js',
],
env: {
es6: true,
node: true,
mocha: true,
},
},
// bin scripts
{
files: ['bin/**/*.js'],
rules: {
'no-process-exit': 'off',
},
},
// source Js
{
files: ['**/src/**/*.js', '**/test/**/*.js'],
env: {
es2020: true,
browser: true,
},
parserOptions: {
sourceType: 'module',
},
},
// TypeScript source
{
files: ['**/*.ts'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': '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,
// this is a great one to ban, will do in a followup PR
'{}': false,
}
}],
// 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',
}
},
],
};