forked from webmachinelearning/webnn-polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
100 lines (100 loc) · 3.74 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
module.exports = {
root: true,
ignorePatterns: ['**/*.js', 'node_modules/'],
env: { 'es6': true, 'browser': true },
parser: '@typescript-eslint/parser',
parserOptions: { 'project': 'tsconfig.json', 'sourceType': 'module' },
plugins: ['@typescript-eslint', 'prefer-arrow', 'import', 'jsdoc'],
rules: {
'@typescript-eslint/array-type': ['error', { 'default': 'array-simple' }],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-types': [
'error', {
'types': {
'Object': { 'message': 'Use {} instead.' },
'String': { 'message': 'Use \'string\' instead.' },
'Number': { 'message': 'Use \'number\' instead.' },
'Boolean': { 'message': 'Use \'boolean\' instead.' }
}
}
],
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/member-delimiter-style': [
'error', {
'multiline': { 'delimiter': 'semi', 'requireLast': true },
'singleline': { 'delimiter': 'semi', 'requireLast': false }
}
],
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-param-reassign': 'off',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/triple-slash-reference':
['error', { 'path': 'always', 'types': 'prefer-import', 'lib': 'always' }],
'arrow-body-style': 'error',
'camelcase': 'error',
'constructor-super': 'error',
'curly': 'error',
'default-case': 'error',
'dot-notation': 'error',
'eqeqeq': ['error', 'smart'],
'guard-for-in': 'off',
'id-match': 'error',
'max-len':
['error', {'code': 80, 'ignoreUrls': true, 'ignorePattern': '^import\\s.+\\sfrom\\s.+;$'}],
'new-parens': 'error',
'no-bitwise': 'off',
'no-caller': 'error',
'no-cond-assign': 'off',
'no-console': 'off',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-duplicate-case': 'error',
'no-empty': 'off',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-invalid-regexp': 'error',
'no-invalid-this': 'error',
'no-multiple-empty-lines': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-return-await': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-underscore-dangle': ['error', {'allowAfterThis': true}],
'no-unsafe-finally': 'error',
'no-unused-expressions': 'off',
'no-unused-labels': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow/prefer-arrow-functions': ['error', {'allowStandaloneDeclarations': true}],
'prefer-const': 'error',
'radix': 'error',
'use-isnan': 'error'
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
};