-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
58 lines (49 loc) · 1.59 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
'use strict';
const EslintPluginHapi = require('@hapi/eslint-plugin');
const TypescriptRules = require('@typescript-eslint/eslint-plugin').rules;
const tsifyRules = function (from) {
const rules = {};
for (const rule in from) {
if (TypescriptRules[rule] && rule !== 'padding-line-between-statements') {
rules[rule] = 'off';
rules[`@typescript-eslint/${rule}`] = from[rule];
}
}
return rules;
};
module.exports = {
root: true,
extends: [
'plugin:@hapi/recommended',
'plugin:@typescript-eslint/eslint-recommended'
],
plugins: [
'@typescript-eslint'
],
parserOptions: {
ecmaVersion: 2019
},
ignorePatterns: ['/lib/*.js', '/lib/*.d.ts'],
overrides: [{
files: ['lib/**/*.ts'],
extends: [
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
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'
}
}]
};