@remcohaszing/eslint 13.0.0 → 14.0.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/README.md +5 -38
- package/lib/config.js +9 -23
- package/package.json +8 -10
- package/types/config.d.ts +2 -2
- package/types/config.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# @remcohaszing/eslint
|
|
2
2
|
|
|
3
|
-
> A strict ESLint configuration
|
|
4
|
-
|
|
5
3
|
[](https://github.com/remcohaszing/eslint/actions)
|
|
6
4
|
[](https://codecov.io/gh/remcohaszing/eslint)
|
|
7
|
-
[](https://www.npmjs.com/package/@remcohaszing/eslint)
|
|
8
|
-
[](https://www.npmjs.com/package/@remcohaszing/eslint)
|
|
6
|
+
[](https://www.npmjs.com/package/@remcohaszing/eslint)
|
|
9
7
|
|
|
10
8
|
This is a strict shareable ESLint configuration. All ESLint core rules and a variety of ESLint
|
|
11
9
|
plugins have been carefully considered. Overrides are used to apply rules based on context.
|
|
@@ -24,42 +22,13 @@ plugins have been carefully considered. Overrides are used to apply rules based
|
|
|
24
22
|
|
|
25
23
|
## Installation
|
|
26
24
|
|
|
27
|
-
Install `@remcohaszing/eslint` using `npm`.
|
|
28
|
-
|
|
29
25
|
```sh
|
|
30
|
-
npm install --save-dev
|
|
31
|
-
eslint \
|
|
32
|
-
@remcohaszing/eslint \
|
|
33
|
-
prettier
|
|
26
|
+
npm install --save-dev @remcohaszing/eslint
|
|
34
27
|
```
|
|
35
28
|
|
|
36
29
|
## Configuration
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
`.editorconfig` with the following content:
|
|
40
|
-
|
|
41
|
-
```ini
|
|
42
|
-
root = true
|
|
43
|
-
|
|
44
|
-
[*]
|
|
45
|
-
charset = utf-8
|
|
46
|
-
end_of_line = lf
|
|
47
|
-
indent_size = 2
|
|
48
|
-
indent_style = space
|
|
49
|
-
insert_final_newline = true
|
|
50
|
-
max_line_length = 100
|
|
51
|
-
trim_trailing_whitespace = true
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
And create a `.prettierrc.yaml` with the following content:
|
|
55
|
-
|
|
56
|
-
```yaml
|
|
57
|
-
proseWrap: always
|
|
58
|
-
singleQuote: true
|
|
59
|
-
trailingComma: all
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Next, create `eslint.config.js` with the following content:
|
|
31
|
+
Create `eslint.config.js` with the following content:
|
|
63
32
|
|
|
64
33
|
```js
|
|
65
34
|
export { default } from '@remcohaszing/eslint'
|
|
@@ -85,8 +54,6 @@ Code blocks in Markdown are linted by default using
|
|
|
85
54
|
[`@eslint/markdown`](https://github.com/eslint/markdown). The type checking rules from
|
|
86
55
|
`@typescript-eslint/eslint-plugin` don’t work with markdown code blocks.
|
|
87
56
|
|
|
88
|
-
`prettier/prettier` is disabled, because it doesn’t play nice with `eslint-plugin-markdown`.
|
|
89
|
-
|
|
90
57
|
Some other rules have been turned off, because these rules may conflict with the purpose of the
|
|
91
58
|
documentation.
|
|
92
59
|
|
|
@@ -126,7 +93,7 @@ eslint
|
|
|
126
93
|
|
|
127
94
|
## Compatibility
|
|
128
95
|
|
|
129
|
-
This project requires Node.js
|
|
96
|
+
This project requires Node.js 24 or greater.
|
|
130
97
|
|
|
131
98
|
## License
|
|
132
99
|
|
package/lib/config.js
CHANGED
|
@@ -6,7 +6,6 @@ import { dirname, join } from 'node:path'
|
|
|
6
6
|
|
|
7
7
|
import { includeIgnoreFile } from '@eslint/compat'
|
|
8
8
|
import markdown from '@eslint/markdown'
|
|
9
|
-
// @ts-expect-error
|
|
10
9
|
import eslintCommunityEslintComments from '@eslint-community/eslint-plugin-eslint-comments'
|
|
11
10
|
import stylistic from '@stylistic/eslint-plugin'
|
|
12
11
|
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
|
@@ -14,13 +13,10 @@ import typescriptEslintParser from '@typescript-eslint/parser'
|
|
|
14
13
|
import confusingBrowserGlobals from 'confusing-browser-globals'
|
|
15
14
|
import { defineConfig } from 'eslint/config'
|
|
16
15
|
import importX from 'eslint-plugin-import-x'
|
|
17
|
-
// @ts-expect-error
|
|
18
|
-
import jestFormatting from 'eslint-plugin-jest-formatting'
|
|
19
16
|
import jsdoc from 'eslint-plugin-jsdoc'
|
|
20
17
|
import n from 'eslint-plugin-n'
|
|
21
18
|
import perfectionist from 'eslint-plugin-perfectionist'
|
|
22
19
|
import { Alphabet } from 'eslint-plugin-perfectionist/alphabet'
|
|
23
|
-
import prettier from 'eslint-plugin-prettier'
|
|
24
20
|
import unicorn from 'eslint-plugin-unicorn'
|
|
25
21
|
import findUp from 'find-up'
|
|
26
22
|
import globals from 'globals'
|
|
@@ -125,6 +121,8 @@ const alphabet = unshiftChar(unshiftChar(characters, '.'), '/')
|
|
|
125
121
|
*/
|
|
126
122
|
const NON_COMPONENT_FUNCTION = 'FunctionDeclaration[id.name=/^[a-z]/]'
|
|
127
123
|
const METHOD_DEFINITION = 'MethodDefinition'
|
|
124
|
+
const TEST_SELECTOR =
|
|
125
|
+
'ExpressionStatement[expression.callee.name=/^(after|afterAll|afterEach|before|beforeAll|beforeEach|describe|it|suite|test)$/]'
|
|
128
126
|
|
|
129
127
|
const config = defineConfig([
|
|
130
128
|
getIgnorePatterns(),
|
|
@@ -154,13 +152,10 @@ const config = defineConfig([
|
|
|
154
152
|
// @ts-expect-error
|
|
155
153
|
'@typescript-eslint': typescriptEslint,
|
|
156
154
|
'@eslint-community/eslint-comments': eslintCommunityEslintComments,
|
|
157
|
-
// @ts-expect-error
|
|
158
155
|
'import-x': importX,
|
|
159
|
-
'jest-formatting': jestFormatting,
|
|
160
156
|
jsdoc,
|
|
161
157
|
n,
|
|
162
158
|
perfectionist,
|
|
163
|
-
prettier,
|
|
164
159
|
unicorn
|
|
165
160
|
},
|
|
166
161
|
settings: {
|
|
@@ -439,7 +434,6 @@ const config = defineConfig([
|
|
|
439
434
|
'@eslint-community/eslint-comments/no-aggregating-enable': 'error',
|
|
440
435
|
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',
|
|
441
436
|
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
442
|
-
'@eslint-community/eslint-comments/no-unused-disable': 'error',
|
|
443
437
|
'@eslint-community/eslint-comments/no-unused-enable': 'error',
|
|
444
438
|
'@eslint-community/eslint-comments/no-use': [
|
|
445
439
|
'error',
|
|
@@ -493,13 +487,13 @@ const config = defineConfig([
|
|
|
493
487
|
|
|
494
488
|
{
|
|
495
489
|
blankLine: 'always',
|
|
496
|
-
prev: 'function',
|
|
490
|
+
prev: ['function', { selector: TEST_SELECTOR }],
|
|
497
491
|
next: '*'
|
|
498
492
|
},
|
|
499
493
|
{
|
|
500
494
|
blankLine: 'always',
|
|
501
495
|
prev: '*',
|
|
502
|
-
next: 'function'
|
|
496
|
+
next: ['function', { selector: TEST_SELECTOR }]
|
|
503
497
|
}
|
|
504
498
|
],
|
|
505
499
|
'@stylistic/quotes': ['error', 'single', { avoidEscape: true, ignoreStringLiterals: true }],
|
|
@@ -555,14 +549,6 @@ const config = defineConfig([
|
|
|
555
549
|
],
|
|
556
550
|
'import-x/no-useless-path-segments': 'error',
|
|
557
551
|
|
|
558
|
-
// https://github.com/dangreenisrael/eslint-plugin-jest-formatting
|
|
559
|
-
'jest-formatting/padding-around-after-all-blocks': 'error',
|
|
560
|
-
'jest-formatting/padding-around-after-each-blocks': 'error',
|
|
561
|
-
'jest-formatting/padding-around-before-all-blocks': 'error',
|
|
562
|
-
'jest-formatting/padding-around-before-each-blocks': 'error',
|
|
563
|
-
'jest-formatting/padding-around-describe-blocks': 'error',
|
|
564
|
-
'jest-formatting/padding-around-test-blocks': 'error',
|
|
565
|
-
|
|
566
552
|
// https://github.com/gajus/eslint-plugin-jsdoc
|
|
567
553
|
'jsdoc/check-access': 'error',
|
|
568
554
|
'jsdoc/check-indentation': [
|
|
@@ -691,9 +677,11 @@ const config = defineConfig([
|
|
|
691
677
|
'n/no-unpublished-bin': 'error',
|
|
692
678
|
'n/prefer-global/buffer': 'error',
|
|
693
679
|
'n/prefer-global/console': 'error',
|
|
680
|
+
'n/prefer-global/crypto': 'error',
|
|
694
681
|
'n/prefer-global/process': 'error',
|
|
695
682
|
'n/prefer-global/text-decoder': 'error',
|
|
696
683
|
'n/prefer-global/text-encoder': 'error',
|
|
684
|
+
'n/prefer-global/timers': 'error',
|
|
697
685
|
'n/prefer-global/url': 'error',
|
|
698
686
|
'n/prefer-global/url-search-params': 'error',
|
|
699
687
|
'n/prefer-promises/dns': 'error',
|
|
@@ -750,9 +738,6 @@ const config = defineConfig([
|
|
|
750
738
|
],
|
|
751
739
|
'perfectionist/sort-union-types': 'error',
|
|
752
740
|
|
|
753
|
-
// https://github.com/prettier/eslint-plugin-prettier
|
|
754
|
-
'prettier/prettier': 'error',
|
|
755
|
-
|
|
756
741
|
// https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
757
742
|
'unicorn/better-regex': 'error',
|
|
758
743
|
'unicorn/catch-error-name': ['error', { name: 'error', ignore: ['cause', 'err', /Error$/] }],
|
|
@@ -761,6 +746,7 @@ const config = defineConfig([
|
|
|
761
746
|
'unicorn/consistent-destructuring': 'error',
|
|
762
747
|
'unicorn/consistent-empty-array-spread': 'error',
|
|
763
748
|
'unicorn/consistent-function-scoping': 'error',
|
|
749
|
+
'unicorn/consistent-template-literal-escape': 'error',
|
|
764
750
|
'unicorn/custom-error-definition': 'error',
|
|
765
751
|
'unicorn/error-message': 'error',
|
|
766
752
|
'unicorn/escape-case': 'error',
|
|
@@ -824,6 +810,7 @@ const config = defineConfig([
|
|
|
824
810
|
'unicorn/no-useless-collection-argument': 'error',
|
|
825
811
|
'unicorn/no-useless-error-capture-stack-trace': 'error',
|
|
826
812
|
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
813
|
+
'unicorn/no-useless-iterator-to-array': 'error',
|
|
827
814
|
'unicorn/no-useless-length-check': 'error',
|
|
828
815
|
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
829
816
|
'unicorn/no-useless-spread': 'error',
|
|
@@ -885,6 +872,7 @@ const config = defineConfig([
|
|
|
885
872
|
'unicorn/require-module-specifiers': 'error',
|
|
886
873
|
'unicorn/require-post-message-target-origin': 'error',
|
|
887
874
|
'unicorn/switch-case-braces': ['error', 'avoid'],
|
|
875
|
+
'unicorn/switch-case-break-position': 'error',
|
|
888
876
|
'unicorn/template-indent': 'error',
|
|
889
877
|
'unicorn/text-encoding-identifier-case': 'error',
|
|
890
878
|
'unicorn/throw-new-error': 'error'
|
|
@@ -1142,8 +1130,6 @@ const config = defineConfig([
|
|
|
1142
1130
|
'n/no-unpublished-import': 'off',
|
|
1143
1131
|
'n/no-unpublished-require': 'off',
|
|
1144
1132
|
|
|
1145
|
-
'prettier/prettier': 'off',
|
|
1146
|
-
|
|
1147
1133
|
'unicorn/consistent-function-scoping': 'off'
|
|
1148
1134
|
}
|
|
1149
1135
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remcohaszing/eslint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "A strict ESLint configuration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -31,30 +31,28 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.0.0",
|
|
33
33
|
"@eslint/compat": "^2.0.0",
|
|
34
|
-
"@eslint/markdown": "^
|
|
34
|
+
"@eslint/markdown": "^8.0.0",
|
|
35
35
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
37
37
|
"@typescript-eslint/parser": "^8.0.0",
|
|
38
38
|
"confusing-browser-globals": "^1.0.0",
|
|
39
39
|
"eslint-plugin-import-x": "^4.0.0",
|
|
40
|
-
"eslint-plugin-
|
|
41
|
-
"eslint-plugin-jsdoc": "^61.0.0",
|
|
40
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
42
41
|
"eslint-plugin-n": "^17.0.0",
|
|
43
42
|
"eslint-plugin-perfectionist": "^5.0.0",
|
|
44
|
-
"eslint-plugin-
|
|
45
|
-
"eslint-plugin-unicorn": "^62.0.0",
|
|
43
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
46
44
|
"find-up": "^5.0.0"
|
|
47
45
|
},
|
|
48
46
|
"devDependencies": {
|
|
49
47
|
"@types/confusing-browser-globals": "^1.0.0",
|
|
50
|
-
"prettier
|
|
48
|
+
"prettier": "^3.0.0",
|
|
49
|
+
"prettier-plugin-packagejson": "^3.0.0",
|
|
51
50
|
"remark-cli": "^12.0.0",
|
|
52
51
|
"remark-preset-remcohaszing": "^3.0.0",
|
|
53
52
|
"type-fest": "^5.0.0",
|
|
54
|
-
"typescript": "^
|
|
53
|
+
"typescript": "^6.0.0"
|
|
55
54
|
},
|
|
56
55
|
"peerDependencies": {
|
|
57
|
-
"eslint": "
|
|
58
|
-
"prettier": "3"
|
|
56
|
+
"eslint": "10"
|
|
59
57
|
}
|
|
60
58
|
}
|
package/types/config.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export function define(overrides: Linter.Config | Linter.Config[]): Linter.Config[];
|
|
10
10
|
export default config;
|
|
11
|
-
export const typechecking: import("eslint/config").Config[];
|
|
11
|
+
export const typechecking: import("@eslint/config-helpers").Config[];
|
|
12
12
|
import type { Linter } from 'eslint';
|
|
13
|
-
declare const config: import("eslint/config").Config[];
|
|
13
|
+
declare const config: import("@eslint/config-helpers").Config[];
|
|
14
14
|
//# sourceMappingURL=config.d.ts.map
|
package/types/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.js"],"names":[],"mappings":"AAisCA;;;;;;;GAOG;AACH,kCALW,aAAa,GAAG,aAAa,EAAE,GAE7B,aAAa,EAAE,CAK3B;;AAxFD,qEA4EE;4BA9rCuB,QAAQ;AA6HjC,gEAi/BE"}
|