-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.js
68 lines (64 loc) · 1.72 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
'use strict'
// @ts-check
/** @type {import('eslint/lib/shared/types').ConfigData} */
module.exports = {
root: true,
ignorePatterns: [
'**/node_modules/',
'/dist/',
'/lib/',
],
env: {
es6: true,
node: true,
},
parserOptions: {
sourceType: 'module',
},
extends: [
'eslint:recommended',
],
// Common rules for all files.
rules: {
},
overrides: [
{
files: '*.ts',
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./tsconfig.json',
'./src/tsconfig.json',
],
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
// Rules for TypeScript files.
rules: {
// Changed options
'@typescript-eslint/ban-types': ['error', {
// Allow to use {} and object - they are actually useful.
types: {
'{}': false,
'object': false,
},
extendDefaults: true,
}],
// Changed from error to warn
'@typescript-eslint/no-namespace': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
// Disabled
'@typescript-eslint/no-explicit-any': 'off', // `any` is sometimes needed
'@typescript-eslint/restrict-template-expressions': 'off', // has false positives
'@typescript-eslint/triple-slash-reference': 'off', // used for njs
'@typescript-eslint/unbound-method': 'off', // has false positives
// Added
'@typescript-eslint/no-require-imports': 'error',
},
},
],
}