generated from xyy94813/js-lib-template-repo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
66 lines (66 loc) · 1.75 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
65
66
module.exports = {
extends: 'standard',
ignorePatterns: [
'node_modules/**/*', // output dir
'dist/**/*', // output dir
'.yarn/**/*', // yarn dir
'.pnp.*', // yarn pnp files
],
overrides: [
{
files: ['types/**/*'],
extends: 'standard-with-typescript',
env: {
browser: true,
es2021: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: { delimiter: 'semi', requireLast: true },
singleline: { delimiter: 'semi', requireLast: false },
multilineDetection: 'brackets',
}],
'@typescript-eslint/consistent-type-imports': 'off', // Event/Map
'@typescript-eslint/method-signature-style': ['error', 'method'],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
},
},
{
// config files
files: [
'.eslintrc.{js,cjs}',
'./commitlint.config.js',
'./jest.config.js',
],
env: {
node: true,
},
parserOptions: {
sourceType: 'script',
},
},
{
// for es-module config js
files: ['./.lintstagedrc.mjs'],
env: {
node: true,
},
parserOptions: {
sourceType: 'module',
},
},
],
rules: {
'comma-dangle': ['error', 'always-multiline'],
},
}