generated from Alorel/basic-library-template-repo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
49 lines (47 loc) · 1.22 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
module.exports = {
extends: [
'@alorel/eslint-config-base',
'@alorel/eslint-config-typescript'
],
ignorePatterns: [
'**/.eslintrc.js',
'/dist',
'/coverage',
'/**/*.d.ts',
'/tmp.ts',
'/tmp.js',
'/tmp.mjs',
'/rollup*.config.js',
'/build'
],
root: true,
parserOptions: {
project: require('path').join(__dirname, 'tsconfig.json')
},
rules: {
'@typescript-eslint/consistent-type-imports': err({prefer: 'type-imports'}),
'no-duplicate-imports': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'comma-dangle': 'off',
'no-nested-ternary': 'off',
'consistent-return': 'off',
'@typescript-eslint/comma-dangle': err({
enums: 'always-multiline',
generics: 'never',
tuples: 'always-multiline',
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'never',
exports: 'never',
functions: 'never'
}),
'prefer-rest-params': 'off',
}
};
/** Shorthand for making an error rule value. Omit param to skip the rule's optional params */
function err() {
return value('error', ...Array.from(arguments));
}
function value(severity, ...opts) {
return opts.length ? [severity, ...opts] : severity;
}