-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.cjs
60 lines (49 loc) · 1.68 KB
/
.eslintrc.cjs
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
'use strict';
const EslintPluginHapi = require('@hapi/eslint-plugin');
const TypescriptRules = require('@typescript-eslint/eslint-plugin').rules;
const denylist = new Set([
'padding-line-between-statements', // Incompatible syntax
'key-spacing' // Currently broken in node v14: https://github.com/typescript-eslint/typescript-eslint/issues/6396
]);
const tsifyRules = function (from) {
const rules = {};
for (const rule in from) {
if (TypescriptRules[rule] && !denylist.has(rule)) {
rules[rule] = 'off';
rules[`@typescript-eslint/${rule}`] = from[rule];
}
}
return rules;
};
module.exports = {
root: true,
extends: [
'plugin:@hapi/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020
},
ignorePatterns: ['lib/**', 'test/*.js'],
overrides: [{
files: ['**/*.ts'],
extends: [
'plugin:@typescript-eslint/recommended'
],
parserOptions: {
sourceType: 'module',
project: './**/tsconfig.json',
tsconfigRootDir: __dirname
},
rules: {
...tsifyRules(EslintPluginHapi.configs.recommended.rules),
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/member-delimiter-style': 'warn',
'@typescript-eslint/no-throw-literal': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/type-annotation-spacing': 'warn',
'@typescript-eslint/unified-signatures': 'warn'
}
}]
};