-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.js
59 lines (53 loc) · 2 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
// eslint-disable-next-line no-undef
/**@type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint', 'mocha', 'chai-expect'],
extends: [
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:mocha/recommended',
'plugin:chai-expect/recommended',
],
rules: {
semi: ['warn', 'always'],
/**
* https://eslint.org/docs/latest/rules/new-parens
*
* Enforce or disallow parentheses when invoking a constructor with no arguments
*
* JavaScript allows the omission of parentheses when invoking a function via the `new` keyword and the constructor has no arguments.
* However, some coders believe that omitting the parentheses is inconsistent with the rest of the language and thus makes code less clear.
*/
'new-parens': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-non-null-assertion': 'off',
/**
* Permits to use arrow functions as no-op.
*
* https://typescript-eslint.io/rules/no-empty-function/
* https://eslint.org/docs/latest/rules/no-empty-function#allow-arrowfunctions
*/
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
/**
* Enforce consistent usage of type imports.
*
* https://typescript-eslint.io/rules/consistent-type-imports
*/
'@typescript-eslint/consistent-type-imports': 'warn',
'mocha/no-setup-in-describe': 'off',
},
overrides: [
{
files: ['src/**/*.ts'],
rules: {
'no-restricted-globals': ['error', 'Buffer'],
'no-console': 'error',
},
},
],
};