-
Notifications
You must be signed in to change notification settings - Fork 1
/
typescript.js
55 lines (47 loc) · 1.14 KB
/
typescript.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
'use strict';
const internalExtends = [
'./index',
'./rules/plugin-typescript',
].map(require.resolve); // eslint-disable-line unicorn/no-array-callback-reference
module.exports = {
extends: [
...internalExtends,
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2023,
sourceType: 'module',
},
plugins: [
'json',
'n',
],
env: {
browser: true,
node: true,
es2020: true,
},
rules: {
'n/no-unsupported-features/es-syntax': 'off',
// disable a few native rules and use their typescript versions
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {
ignoreRestSiblings: true,
}],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'n/no-missing-import': 'off',
'no-duplicate-imports': 'off',
'no-undef': 'off',
'unicorn/custom-error-definition': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message: 'Don\'t declare enums - they\'re difficult to transpile. Use object literals instead.',
},
],
},
};