@jarsec/eslint-config 4.5.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/configs/style.js +142 -0
- package/index.js +56 -22
- package/package.json +14 -10
- package/javascript.js +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @jarsec/eslint-config
|
|
2
2
|
|
|
3
|
+
## 5.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6dd6e99: Tweaks to unicorn and stylistic rules
|
|
8
|
+
|
|
9
|
+
## 5.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- c703d78: Refactor eslint configuration
|
|
14
|
+
|
|
15
|
+
Version 5 brings the following changes:
|
|
16
|
+
|
|
17
|
+
- Removal of xo and xo-typescript
|
|
18
|
+
- Separation of javascript and typescript rules
|
|
19
|
+
- Introduction of @stylistic/eslint-plugin and associated rules (to replace dprint/prettier)
|
|
20
|
+
- Addition of node-specific lint rules
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 6c2981c: fix(renovate): Update patch dependencies (patch)
|
|
25
|
+
- cc5eb8e: fix(renovate): Update minor (minor)
|
|
26
|
+
|
|
3
27
|
## 4.5.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/configs/style.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
3
|
+
'@stylistic/array-bracket-spacing': ['error', 'never', {
|
|
4
|
+
arraysInArrays: true,
|
|
5
|
+
objectsInArrays: false,
|
|
6
|
+
singleValue: true
|
|
7
|
+
}],
|
|
8
|
+
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
9
|
+
'@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
|
|
10
|
+
'@stylistic/arrow-spacing': 'error',
|
|
11
|
+
'@stylistic/block-spacing': 'error',
|
|
12
|
+
'@stylistic/brace-style': ['error', '1tbs', {
|
|
13
|
+
allowSingleLine: true
|
|
14
|
+
}],
|
|
15
|
+
'@stylistic/comma-dangle': ['error', 'only-multiline'],
|
|
16
|
+
'@stylistic/comma-spacing': 'error',
|
|
17
|
+
'@stylistic/comma-style': ['error', 'last'],
|
|
18
|
+
'@stylistic/computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
|
|
19
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
20
|
+
'@stylistic/eol-last': ['error', 'always'],
|
|
21
|
+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
22
|
+
'@stylistic/function-call-spacing': 'error',
|
|
23
|
+
'@stylistic/function-paren-newline': ['error', 'consistent'],
|
|
24
|
+
'@stylistic/generator-star-spacing': ['error', 'after'],
|
|
25
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
26
|
+
'@stylistic/indent': ['error', 2],
|
|
27
|
+
'@stylistic/indent-binary-ops': ['error', 2],
|
|
28
|
+
'@stylistic/key-spacing': ['error', {
|
|
29
|
+
multiLine: {
|
|
30
|
+
afterColon: true,
|
|
31
|
+
beforeColon: false,
|
|
32
|
+
mode: 'strict'
|
|
33
|
+
},
|
|
34
|
+
singleLine: {
|
|
35
|
+
afterColon: true,
|
|
36
|
+
beforeColon: false,
|
|
37
|
+
mode: 'strict'
|
|
38
|
+
}
|
|
39
|
+
}],
|
|
40
|
+
'@stylistic/keyword-spacing': 'error',
|
|
41
|
+
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
42
|
+
'@stylistic/lines-around-comment': ['error', {
|
|
43
|
+
allowBlockStart: true,
|
|
44
|
+
beforeBlockComment: true,
|
|
45
|
+
}],
|
|
46
|
+
'@stylistic/lines-between-class-members': ['error', 'always'],
|
|
47
|
+
'@stylistic/max-len': ['error', {
|
|
48
|
+
code: 100,
|
|
49
|
+
comments: 80,
|
|
50
|
+
ignoreTrailingComments: true,
|
|
51
|
+
ignoreUrls: true,
|
|
52
|
+
tabWidth: 2
|
|
53
|
+
}],
|
|
54
|
+
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
|
|
55
|
+
'@stylistic/member-delimiter-style': ['error', {
|
|
56
|
+
multiline: {
|
|
57
|
+
delimiter: 'comma',
|
|
58
|
+
requireLast: true
|
|
59
|
+
},
|
|
60
|
+
multilineDetection: 'brackets',
|
|
61
|
+
singleline: {
|
|
62
|
+
delimiter: 'comma',
|
|
63
|
+
requireLast: false
|
|
64
|
+
}
|
|
65
|
+
}],
|
|
66
|
+
'@stylistic/multiline-ternary': ['error', 'always'],
|
|
67
|
+
'@stylistic/new-parens': ['error', 'always'],
|
|
68
|
+
'@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
|
|
69
|
+
'@stylistic/no-confusing-arrow': ['error', {
|
|
70
|
+
allowParens: true,
|
|
71
|
+
onlyOneSimpleParam: true
|
|
72
|
+
}],
|
|
73
|
+
'@stylistic/no-extra-parens': ['error', 'all', {
|
|
74
|
+
nestedBinaryExpressions: false
|
|
75
|
+
}],
|
|
76
|
+
'@stylistic/no-extra-semi': 'error',
|
|
77
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
78
|
+
'@stylistic/no-mixed-operators': 'error',
|
|
79
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
80
|
+
'@stylistic/no-multi-spaces': 'error',
|
|
81
|
+
'@stylistic/no-multiple-empty-lines': ['error', {
|
|
82
|
+
max: 1,
|
|
83
|
+
maxEOF: 1
|
|
84
|
+
}],
|
|
85
|
+
'@stylistic/no-tabs': ['error', { allowIndentationTabs: true }],
|
|
86
|
+
'@stylistic/no-trailing-spaces': ['error', {
|
|
87
|
+
ignoreComments: false,
|
|
88
|
+
skipBlankLines: false
|
|
89
|
+
}],
|
|
90
|
+
'@stylistic/no-whitespace-before-property': 'error',
|
|
91
|
+
'@stylistic/nonblock-statement-body-position': ['error', 'below'],
|
|
92
|
+
'@stylistic/object-curly-newline': ['error', {
|
|
93
|
+
consistent: true,
|
|
94
|
+
minProperties: 3
|
|
95
|
+
}],
|
|
96
|
+
'@stylistic/object-curly-spacing': ['error', 'always', {
|
|
97
|
+
arraysInObjects: false,
|
|
98
|
+
objectsInObjects: false
|
|
99
|
+
}],
|
|
100
|
+
'@stylistic/one-var-declaration-per-line': ['error', 'initializations'],
|
|
101
|
+
'@stylistic/operator-linebreak': ['error', 'after', {
|
|
102
|
+
overrides: {
|
|
103
|
+
':': 'before',
|
|
104
|
+
'?': 'before'
|
|
105
|
+
}
|
|
106
|
+
}],
|
|
107
|
+
'@stylistic/padded-blocks': ['error', 'never'],
|
|
108
|
+
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
|
|
109
|
+
'@stylistic/quotes': ['error', 'single', {
|
|
110
|
+
allowTemplateLiterals: true,
|
|
111
|
+
avoidEscape: true
|
|
112
|
+
}],
|
|
113
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
114
|
+
'@stylistic/semi': ['error', 'always'],
|
|
115
|
+
'@stylistic/semi-spacing': 'error',
|
|
116
|
+
'@stylistic/semi-style': 'error',
|
|
117
|
+
'@stylistic/space-before-blocks': 'error',
|
|
118
|
+
'@stylistic/space-before-function-paren': ['error', {
|
|
119
|
+
anonymous: 'always',
|
|
120
|
+
asyncArrow: 'always',
|
|
121
|
+
named: 'never'
|
|
122
|
+
}],
|
|
123
|
+
'@stylistic/space-in-parens': ['error', 'never'],
|
|
124
|
+
'@stylistic/switch-colon-spacing': 'error',
|
|
125
|
+
'@stylistic/template-curly-spacing': 'error',
|
|
126
|
+
'@stylistic/template-tag-spacing': ['error', 'always'],
|
|
127
|
+
'@stylistic/type-annotation-spacing': ['error', {
|
|
128
|
+
after: true,
|
|
129
|
+
before: false,
|
|
130
|
+
overrides: {
|
|
131
|
+
arrow: {
|
|
132
|
+
after: true,
|
|
133
|
+
before: true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}],
|
|
137
|
+
'@stylistic/type-generic-spacing': 'error',
|
|
138
|
+
'@stylistic/type-named-tuple-spacing': 'error',
|
|
139
|
+
'@stylistic/wrap-regex': 'error',
|
|
140
|
+
'@stylistic/yield-star-spacing': ['error', 'after']
|
|
141
|
+
};
|
|
142
|
+
|
package/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
1
|
+
require('@rushstack/eslint-patch/modern-module-resolution');
|
|
2
|
+
|
|
3
|
+
const styleRules = require('./configs/style');
|
|
2
4
|
|
|
3
5
|
module.exports = {
|
|
4
6
|
env: {
|
|
@@ -6,28 +8,60 @@ module.exports = {
|
|
|
6
8
|
},
|
|
7
9
|
extends: [
|
|
8
10
|
'eslint:recommended',
|
|
9
|
-
'plugin
|
|
10
|
-
'plugin
|
|
11
|
+
'plugin:n/recommended',
|
|
12
|
+
'plugin:import/recommended',
|
|
11
13
|
'plugin:unicorn/recommended',
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
'plugin:perfectionist/recommended-natural'
|
|
15
|
+
],
|
|
16
|
+
overrides: [
|
|
17
|
+
{
|
|
18
|
+
extends: [
|
|
19
|
+
'plugin:@typescript-eslint/recommended',
|
|
20
|
+
'plugin:import/typescript'
|
|
21
|
+
],
|
|
22
|
+
files: [ '*.ts' ],
|
|
23
|
+
parser: '@typescript-eslint/parser',
|
|
24
|
+
parserOptions: {
|
|
25
|
+
project: './tsconfig.json'
|
|
26
|
+
},
|
|
27
|
+
plugins: [
|
|
28
|
+
'@typescript-eslint/eslint-plugin'
|
|
29
|
+
],
|
|
30
|
+
rules: {
|
|
31
|
+
...styleRules,
|
|
32
|
+
'import/no-unresolved': 'error'
|
|
33
|
+
},
|
|
34
|
+
settings: {
|
|
35
|
+
'import/parsers': {
|
|
36
|
+
'@typescript-eslint/parser': [ '.ts' ]
|
|
37
|
+
},
|
|
38
|
+
'import/resolver': {
|
|
39
|
+
node: true,
|
|
40
|
+
typescript: {
|
|
41
|
+
alwaysTryTypes: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
15
46
|
],
|
|
16
|
-
parser: '@typescript-eslint/parser',
|
|
17
|
-
parserOptions: {
|
|
18
|
-
project: './tsconfig.json',
|
|
19
|
-
},
|
|
20
47
|
plugins: [
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'unicorn'
|
|
48
|
+
'import',
|
|
49
|
+
'perfectionist',
|
|
50
|
+
'unicorn',
|
|
51
|
+
'@stylistic'
|
|
26
52
|
],
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
53
|
+
rules: {
|
|
54
|
+
...styleRules,
|
|
55
|
+
'multiline-comment-style': [
|
|
56
|
+
'error',
|
|
57
|
+
'separate-lines'
|
|
58
|
+
],
|
|
59
|
+
'n/no-missing-import': 'off',
|
|
60
|
+
'n/no-process-exit': 'off',
|
|
61
|
+
'unicorn/no-process-exit': 'off',
|
|
62
|
+
'unicorn/prefer-module': 'off',
|
|
63
|
+
'unicorn/prefer-top-level-await': 'off',
|
|
64
|
+
'unicorn/prevent-abbreviations': 'off'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jarsec/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "jsec's eslint configurations",
|
|
5
5
|
"author": "Jarrod Seccombe <jarrod.seccombe@icloud.com>",
|
|
6
6
|
"main": "index.js",
|
|
@@ -9,28 +9,32 @@
|
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@eslint/js": "^8.57.0",
|
|
12
13
|
"@rushstack/eslint-patch": "^1.7.2",
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
15
|
-
"@typescript-eslint/
|
|
16
|
-
"eslint": "^
|
|
17
|
-
"eslint
|
|
18
|
-
"eslint-
|
|
19
|
-
"eslint-config-xo-typescript": "^3.0.0",
|
|
14
|
+
"@stylistic/eslint-plugin": "^1.6.3",
|
|
15
|
+
"@types/node": "^20.11.20",
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
17
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
18
|
+
"eslint": "^8.57.0",
|
|
19
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
20
20
|
"eslint-plugin-import": "^2.29.1",
|
|
21
21
|
"eslint-plugin-n": "^16.6.2",
|
|
22
22
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
23
23
|
"eslint-plugin-promise": "^6.1.1",
|
|
24
24
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
25
|
+
"globals": "^14.0.0",
|
|
25
26
|
"typescript": "^5.3.3"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^20.11.
|
|
29
|
-
"eslint": "^8.
|
|
29
|
+
"@types/node": "^20.11.20",
|
|
30
|
+
"eslint": "^8.57.0",
|
|
30
31
|
"typescript": "^5.3.3"
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"eslint": "^8.56.0",
|
|
34
35
|
"typescript": "^5.2.2"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"lint": "eslint --fix ."
|
|
35
39
|
}
|
|
36
40
|
}
|
package/javascript.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
env: {
|
|
5
|
-
node: true
|
|
6
|
-
},
|
|
7
|
-
extends: [
|
|
8
|
-
'eslint:recommended',
|
|
9
|
-
'plugin:promise/recommended',
|
|
10
|
-
'plugin:unicorn/recommended',
|
|
11
|
-
'xo',
|
|
12
|
-
'plugin:perfectionist/recommended-natural',
|
|
13
|
-
],
|
|
14
|
-
plugins: [
|
|
15
|
-
'import',
|
|
16
|
-
'perfectionist',
|
|
17
|
-
'promise'
|
|
18
|
-
],
|
|
19
|
-
settings: {
|
|
20
|
-
'import/resolver': {
|
|
21
|
-
node: true,
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|