@remcohaszing/eslint 13.0.0 → 14.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/README.md +5 -38
- package/lib/config.js +36 -35
- package/package.json +9 -12
- 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
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {Linter} from 'eslint'
|
|
2
|
+
* @import { Linter } from 'eslint'
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { dirname, join } from 'node:path'
|
|
6
6
|
|
|
7
|
-
import { includeIgnoreFile } from '@eslint/compat'
|
|
8
7
|
import markdown from '@eslint/markdown'
|
|
9
|
-
// @ts-expect-error
|
|
10
8
|
import eslintCommunityEslintComments from '@eslint-community/eslint-plugin-eslint-comments'
|
|
11
9
|
import stylistic from '@stylistic/eslint-plugin'
|
|
12
10
|
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
|
13
11
|
import typescriptEslintParser from '@typescript-eslint/parser'
|
|
14
12
|
import confusingBrowserGlobals from 'confusing-browser-globals'
|
|
15
|
-
import { defineConfig } from 'eslint/config'
|
|
13
|
+
import { defineConfig, includeIgnoreFile } from 'eslint/config'
|
|
16
14
|
import importX from 'eslint-plugin-import-x'
|
|
17
|
-
// @ts-expect-error
|
|
18
|
-
import jestFormatting from 'eslint-plugin-jest-formatting'
|
|
19
15
|
import jsdoc from 'eslint-plugin-jsdoc'
|
|
20
16
|
import n from 'eslint-plugin-n'
|
|
21
17
|
import perfectionist from 'eslint-plugin-perfectionist'
|
|
22
18
|
import { Alphabet } from 'eslint-plugin-perfectionist/alphabet'
|
|
23
|
-
import prettier from 'eslint-plugin-prettier'
|
|
24
19
|
import unicorn from 'eslint-plugin-unicorn'
|
|
25
20
|
import findUp from 'find-up'
|
|
26
21
|
import globals from 'globals'
|
|
@@ -125,6 +120,8 @@ const alphabet = unshiftChar(unshiftChar(characters, '.'), '/')
|
|
|
125
120
|
*/
|
|
126
121
|
const NON_COMPONENT_FUNCTION = 'FunctionDeclaration[id.name=/^[a-z]/]'
|
|
127
122
|
const METHOD_DEFINITION = 'MethodDefinition'
|
|
123
|
+
const TEST_SELECTOR =
|
|
124
|
+
'ExpressionStatement[expression.callee.name=/^(after|afterAll|afterEach|before|beforeAll|beforeEach|describe|it|suite|test)$/]'
|
|
128
125
|
|
|
129
126
|
const config = defineConfig([
|
|
130
127
|
getIgnorePatterns(),
|
|
@@ -154,13 +151,10 @@ const config = defineConfig([
|
|
|
154
151
|
// @ts-expect-error
|
|
155
152
|
'@typescript-eslint': typescriptEslint,
|
|
156
153
|
'@eslint-community/eslint-comments': eslintCommunityEslintComments,
|
|
157
|
-
// @ts-expect-error
|
|
158
154
|
'import-x': importX,
|
|
159
|
-
'jest-formatting': jestFormatting,
|
|
160
155
|
jsdoc,
|
|
161
156
|
n,
|
|
162
157
|
perfectionist,
|
|
163
|
-
prettier,
|
|
164
158
|
unicorn
|
|
165
159
|
},
|
|
166
160
|
settings: {
|
|
@@ -334,7 +328,6 @@ const config = defineConfig([
|
|
|
334
328
|
'no-new': 'error',
|
|
335
329
|
'no-new-func': 'error',
|
|
336
330
|
'no-new-native-nonconstructor': 'error',
|
|
337
|
-
'no-new-wrappers': 'error',
|
|
338
331
|
'no-obj-calls': 'error',
|
|
339
332
|
'no-object-constructor': 'error',
|
|
340
333
|
'no-octal-escape': 'error',
|
|
@@ -389,7 +382,7 @@ const config = defineConfig([
|
|
|
389
382
|
'no-unused-expressions': ['error', { enforceForJSX: true }],
|
|
390
383
|
'no-unused-labels': 'error',
|
|
391
384
|
'no-unused-private-class-members': 'error',
|
|
392
|
-
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
385
|
+
'no-unused-vars': ['error', { ignoreRestSiblings: true, ignoreUsingDeclarations: true }],
|
|
393
386
|
'no-use-before-define': 'error',
|
|
394
387
|
'no-useless-assignment': 'error',
|
|
395
388
|
'no-useless-backreference': 'error',
|
|
@@ -439,7 +432,6 @@ const config = defineConfig([
|
|
|
439
432
|
'@eslint-community/eslint-comments/no-aggregating-enable': 'error',
|
|
440
433
|
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',
|
|
441
434
|
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
442
|
-
'@eslint-community/eslint-comments/no-unused-disable': 'error',
|
|
443
435
|
'@eslint-community/eslint-comments/no-unused-enable': 'error',
|
|
444
436
|
'@eslint-community/eslint-comments/no-use': [
|
|
445
437
|
'error',
|
|
@@ -493,13 +485,13 @@ const config = defineConfig([
|
|
|
493
485
|
|
|
494
486
|
{
|
|
495
487
|
blankLine: 'always',
|
|
496
|
-
prev: 'function',
|
|
488
|
+
prev: ['function', { selector: TEST_SELECTOR }],
|
|
497
489
|
next: '*'
|
|
498
490
|
},
|
|
499
491
|
{
|
|
500
492
|
blankLine: 'always',
|
|
501
493
|
prev: '*',
|
|
502
|
-
next: 'function'
|
|
494
|
+
next: ['function', { selector: TEST_SELECTOR }]
|
|
503
495
|
}
|
|
504
496
|
],
|
|
505
497
|
'@stylistic/quotes': ['error', 'single', { avoidEscape: true, ignoreStringLiterals: true }],
|
|
@@ -555,21 +547,31 @@ const config = defineConfig([
|
|
|
555
547
|
],
|
|
556
548
|
'import-x/no-useless-path-segments': 'error',
|
|
557
549
|
|
|
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
550
|
// https://github.com/gajus/eslint-plugin-jsdoc
|
|
567
551
|
'jsdoc/check-access': 'error',
|
|
568
552
|
'jsdoc/check-indentation': [
|
|
569
553
|
'error',
|
|
570
|
-
{
|
|
554
|
+
{
|
|
555
|
+
excludeTags: [
|
|
556
|
+
'example',
|
|
557
|
+
'param',
|
|
558
|
+
'property',
|
|
559
|
+
'returns',
|
|
560
|
+
'template',
|
|
561
|
+
'throws',
|
|
562
|
+
'todo',
|
|
563
|
+
'typedef'
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
],
|
|
567
|
+
'jsdoc/check-line-alignment': [
|
|
568
|
+
'error',
|
|
569
|
+
'never',
|
|
570
|
+
{
|
|
571
|
+
wrapIndent: ' ',
|
|
572
|
+
tags: ['example', 'param', 'property', 'returns', 'template', 'throws', 'todo', 'typedef']
|
|
573
|
+
}
|
|
571
574
|
],
|
|
572
|
-
'jsdoc/check-line-alignment': ['error', 'never', { wrapIndent: ' ' }],
|
|
573
575
|
'jsdoc/check-param-names': ['error', { checkDestructured: false }],
|
|
574
576
|
'jsdoc/check-tag-names': ['error', { jsxTags: true }],
|
|
575
577
|
'jsdoc/check-template-names': 'error',
|
|
@@ -635,7 +637,6 @@ const config = defineConfig([
|
|
|
635
637
|
]
|
|
636
638
|
}
|
|
637
639
|
],
|
|
638
|
-
'jsdoc/no-undefined-types': 'error',
|
|
639
640
|
'jsdoc/prefer-import-tag': ['error', { exemptTypedefs: false, outputType: 'named-import' }],
|
|
640
641
|
'jsdoc/reject-any-type': 'error',
|
|
641
642
|
'jsdoc/reject-function-type': 'error',
|
|
@@ -691,9 +692,11 @@ const config = defineConfig([
|
|
|
691
692
|
'n/no-unpublished-bin': 'error',
|
|
692
693
|
'n/prefer-global/buffer': 'error',
|
|
693
694
|
'n/prefer-global/console': 'error',
|
|
695
|
+
'n/prefer-global/crypto': 'error',
|
|
694
696
|
'n/prefer-global/process': 'error',
|
|
695
697
|
'n/prefer-global/text-decoder': 'error',
|
|
696
698
|
'n/prefer-global/text-encoder': 'error',
|
|
699
|
+
'n/prefer-global/timers': 'error',
|
|
697
700
|
'n/prefer-global/url': 'error',
|
|
698
701
|
'n/prefer-global/url-search-params': 'error',
|
|
699
702
|
'n/prefer-promises/dns': 'error',
|
|
@@ -750,9 +753,6 @@ const config = defineConfig([
|
|
|
750
753
|
],
|
|
751
754
|
'perfectionist/sort-union-types': 'error',
|
|
752
755
|
|
|
753
|
-
// https://github.com/prettier/eslint-plugin-prettier
|
|
754
|
-
'prettier/prettier': 'error',
|
|
755
|
-
|
|
756
756
|
// https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
757
757
|
'unicorn/better-regex': 'error',
|
|
758
758
|
'unicorn/catch-error-name': ['error', { name: 'error', ignore: ['cause', 'err', /Error$/] }],
|
|
@@ -761,6 +761,7 @@ const config = defineConfig([
|
|
|
761
761
|
'unicorn/consistent-destructuring': 'error',
|
|
762
762
|
'unicorn/consistent-empty-array-spread': 'error',
|
|
763
763
|
'unicorn/consistent-function-scoping': 'error',
|
|
764
|
+
'unicorn/consistent-template-literal-escape': 'error',
|
|
764
765
|
'unicorn/custom-error-definition': 'error',
|
|
765
766
|
'unicorn/error-message': 'error',
|
|
766
767
|
'unicorn/escape-case': 'error',
|
|
@@ -794,7 +795,6 @@ const config = defineConfig([
|
|
|
794
795
|
'unicorn/no-array-for-each': 'error',
|
|
795
796
|
'unicorn/no-array-method-this-argument': 'error',
|
|
796
797
|
'unicorn/no-array-reduce': 'error',
|
|
797
|
-
'unicorn/no-array-sort': 'error',
|
|
798
798
|
'unicorn/no-await-in-promise-methods': 'error',
|
|
799
799
|
'unicorn/no-console-spaces': 'error',
|
|
800
800
|
'unicorn/no-document-cookie': 'error',
|
|
@@ -802,7 +802,6 @@ const config = defineConfig([
|
|
|
802
802
|
'unicorn/no-for-loop': 'error',
|
|
803
803
|
'unicorn/no-hex-escape': 'error',
|
|
804
804
|
'unicorn/no-immediate-mutation': 'error',
|
|
805
|
-
'unicorn/no-instanceof-builtins': 'error',
|
|
806
805
|
'unicorn/no-invalid-fetch-options': 'error',
|
|
807
806
|
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
808
807
|
'unicorn/no-lonely-if': 'error',
|
|
@@ -824,6 +823,7 @@ const config = defineConfig([
|
|
|
824
823
|
'unicorn/no-useless-collection-argument': 'error',
|
|
825
824
|
'unicorn/no-useless-error-capture-stack-trace': 'error',
|
|
826
825
|
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
826
|
+
'unicorn/no-useless-iterator-to-array': 'error',
|
|
827
827
|
'unicorn/no-useless-length-check': 'error',
|
|
828
828
|
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
829
829
|
'unicorn/no-useless-spread': 'error',
|
|
@@ -885,6 +885,7 @@ const config = defineConfig([
|
|
|
885
885
|
'unicorn/require-module-specifiers': 'error',
|
|
886
886
|
'unicorn/require-post-message-target-origin': 'error',
|
|
887
887
|
'unicorn/switch-case-braces': ['error', 'avoid'],
|
|
888
|
+
'unicorn/switch-case-break-position': 'error',
|
|
888
889
|
'unicorn/template-indent': 'error',
|
|
889
890
|
'unicorn/text-encoding-identifier-case': 'error',
|
|
890
891
|
'unicorn/throw-new-error': 'error'
|
|
@@ -1029,11 +1030,13 @@ const config = defineConfig([
|
|
|
1029
1030
|
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
1030
1031
|
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
1031
1032
|
'@typescript-eslint/no-unused-expressions': ['error', { enforceForJSX: true }],
|
|
1032
|
-
'@typescript-eslint/no-unused-vars': [
|
|
1033
|
+
'@typescript-eslint/no-unused-vars': [
|
|
1034
|
+
'error',
|
|
1035
|
+
{ ignoreRestSiblings: true, ignoreUsingDeclarations: true }
|
|
1036
|
+
],
|
|
1033
1037
|
'@typescript-eslint/no-use-before-define': 'error',
|
|
1034
1038
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
1035
1039
|
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
1036
|
-
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
1037
1040
|
'@typescript-eslint/parameter-properties': 'error',
|
|
1038
1041
|
'@typescript-eslint/prefer-as-const': 'error',
|
|
1039
1042
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
@@ -1142,8 +1145,6 @@ const config = defineConfig([
|
|
|
1142
1145
|
'n/no-unpublished-import': 'off',
|
|
1143
1146
|
'n/no-unpublished-require': 'off',
|
|
1144
1147
|
|
|
1145
|
-
'prettier/prettier': 'off',
|
|
1146
|
-
|
|
1147
1148
|
'unicorn/consistent-function-scoping': 'off'
|
|
1148
1149
|
}
|
|
1149
1150
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remcohaszing/eslint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "A strict ESLint configuration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -30,31 +30,28 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.0.0",
|
|
33
|
-
"@eslint/
|
|
34
|
-
"@eslint/markdown": "^7.0.0",
|
|
33
|
+
"@eslint/markdown": "^8.0.0",
|
|
35
34
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
36
35
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
37
36
|
"@typescript-eslint/parser": "^8.0.0",
|
|
38
37
|
"confusing-browser-globals": "^1.0.0",
|
|
39
38
|
"eslint-plugin-import-x": "^4.0.0",
|
|
40
|
-
"eslint-plugin-
|
|
41
|
-
"eslint-plugin-
|
|
42
|
-
"eslint-plugin-n": "^17.0.0",
|
|
39
|
+
"eslint-plugin-jsdoc": "^63.0.0",
|
|
40
|
+
"eslint-plugin-n": "^18.0.0",
|
|
43
41
|
"eslint-plugin-perfectionist": "^5.0.0",
|
|
44
|
-
"eslint-plugin-
|
|
45
|
-
"eslint-plugin-unicorn": "^62.0.0",
|
|
42
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
46
43
|
"find-up": "^5.0.0"
|
|
47
44
|
},
|
|
48
45
|
"devDependencies": {
|
|
49
46
|
"@types/confusing-browser-globals": "^1.0.0",
|
|
50
|
-
"prettier
|
|
47
|
+
"prettier": "^3.0.0",
|
|
48
|
+
"prettier-plugin-packagejson": "^3.0.0",
|
|
51
49
|
"remark-cli": "^12.0.0",
|
|
52
50
|
"remark-preset-remcohaszing": "^3.0.0",
|
|
53
51
|
"type-fest": "^5.0.0",
|
|
54
|
-
"typescript": "^
|
|
52
|
+
"typescript": "^6.0.0"
|
|
55
53
|
},
|
|
56
54
|
"peerDependencies": {
|
|
57
|
-
"eslint": "
|
|
58
|
-
"prettier": "3"
|
|
55
|
+
"eslint": "10"
|
|
59
56
|
}
|
|
60
57
|
}
|
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":"AAgtCA;;;;;;;GAOG;AACH,kCALW,aAAa,GAAG,aAAa,EAAE,GAE7B,aAAa,EAAE,CAK3B;;AAxFD,4DA4EE;4BA7sCyB,QAAQ;AA4HnC,uDAigCE"}
|