forked from mongodb-js/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
64 lines (60 loc) · 2.15 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
const typescriptEslintEslintPlugin = require('@typescript-eslint/eslint-plugin');
// Overrides do not work with extends.
const ruleOverridesForJs = Object.keys(typescriptEslintEslintPlugin.rules).reduce(
(overrides, rule) => ({ ...overrides, [`@typescript-eslint/${rule}`]: 0 }), {}
);
module.exports = {
plugins: ['mocha', '@typescript-eslint'],
parser: '@typescript-eslint/parser', // Specifies the ESLint parser.
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: [
'./tsconfig.json'
]
},
extends: [
'eslint-config-mongodb-js/react',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
rules: {
'chai-friendly/no-unused-expressions': 0,
'object-curly-spacing': [2, 'always'],
'no-empty-function': 0,
'valid-jsdoc': 0,
'react/sort-comp': 0, // Does not seem work as expected with typescript.
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-types': 0,
'mocha/no-skipped-tests': 1,
'mocha/no-exclusive-tests': 2,
'semi': 0,
'@typescript-eslint/semi': [2, 'always'],
'no-console': [1, { allow: ['warn', 'error', 'info'] }],
'no-shadow': 0,
'no-use-before-define': 0,
'no-cond-assign': [2, 'except-parens'],
'space-before-function-paren': 0,
'@typescript-eslint/no-floating-promises': 0,
'restrict-template-expressions': 0,
'@typescript-eslint/restrict-template-expressions': 0,
// VV These rules we'd like to turn off one day so they error.
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn'
},
overrides: [{
files: ['**/*.js'],
rules: {
...ruleOverridesForJs,
semi: [2, 'always']
}
}]
};