-
Notifications
You must be signed in to change notification settings - Fork 5
/
base-typescript.js
43 lines (43 loc) · 1.29 KB
/
base-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
module.exports = {
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/eslint-recommended'],
parserOptions: {
sourceType: 'module',
errorOnUnknownASTType: true,
errorOnTypeScriptSyntacticAndSemanticIssues: true,
warnOnUnsupportedTypeScriptVersion: false,
ecmaVersion: 6,
},
rules: {
/**
* @note: you must disable the base rule
* as it can report incorrect errors in @typescript-eslint
*/
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/no-inferrable-types': [
'error',
{ ignoreParameters: true },
],
'@typescript-eslint/prefer-readonly': ['error'],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{ accessibility: 'no-public' },
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/array-type': [
'error',
{ default: 'array', readonly: 'array-simple' },
],
},
},
],
};