-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
45 lines (45 loc) · 1.32 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
// allows imports
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended',
// turn on eslint-plugin-prettier and eslint-config-prettier
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
rules: {
'no-restricted-syntax': [
'error',
{
selector: 'ExportDefaultDeclaration',
message: 'Prefer named exports',
},
],
'@typescript-eslint/array-type': ['error', 'array-simple'],
'@typescript-eslint/ban-types': [
'error',
{
types: {
Object: 'Use {} instead.',
String: "Use 'string' instead.",
Number: "Use 'number' instead.",
Boolean: "Use 'boolean' instead.",
},
},
],
// PascalCase for classes
'@typescript-eslint/class-name-casing': ['error'],
// allow 'I' prefix to interface names
'@typescript-eslint/interface-name-prefix': ['off'],
'@typescript-eslint/no-inferrable-types': ['error'],
// namespaces and modules are outdated, use ES6 style
'@typescript-eslint/no-namespace': ['error'],
// use ES6-style imports instead
'@typescript-eslint/no-triple-slash-reference': ['error'],
},
}