@w5s/eslint-config 3.3.1 → 3.3.3
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/dist/index.d.ts +160 -144
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/config/imports.ts +13 -7
- package/src/config/jsdoc.ts +5 -6
- package/src/type/PluginOptionsBase.ts +2 -0
- package/src/typegen/jsdoc.d.ts +2 -0
- package/src/typegen/unicorn.d.ts +158 -144
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
63
63
|
"@typescript-eslint/parser": "^8.0.0",
|
|
64
64
|
"@vitest/eslint-plugin": "^1.0.0",
|
|
65
|
-
"@w5s/dev": "^3.1.
|
|
65
|
+
"@w5s/dev": "^3.1.4",
|
|
66
66
|
"@w5s/prettier-config": "^3.0.5",
|
|
67
|
-
"eslint-plugin-import": "
|
|
68
|
-
"eslint-plugin-jsdoc": "
|
|
69
|
-
"eslint-plugin-jsonc": "
|
|
70
|
-
"eslint-plugin-n": "
|
|
71
|
-
"eslint-plugin-unicorn": "
|
|
72
|
-
"eslint-plugin-yml": "
|
|
67
|
+
"eslint-plugin-import": "~2.32.0",
|
|
68
|
+
"eslint-plugin-jsdoc": "~62.6.1",
|
|
69
|
+
"eslint-plugin-jsonc": "~2.21.1",
|
|
70
|
+
"eslint-plugin-n": "~17.24.0",
|
|
71
|
+
"eslint-plugin-unicorn": "~63.0.0",
|
|
72
|
+
"eslint-plugin-yml": "~2.0.2",
|
|
73
73
|
"find-up": "^8.0.0",
|
|
74
74
|
"globals": "^17.0.0",
|
|
75
75
|
"jsonc-eslint-parser": "^2.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@typescript-eslint/parser": "8.56.0",
|
|
84
84
|
"eslint": "9.39.2",
|
|
85
85
|
"eslint-find-rules": "5.0.0",
|
|
86
|
-
"eslint-typegen": "2.3.
|
|
86
|
+
"eslint-typegen": "2.3.1",
|
|
87
87
|
"react": "19.2.4",
|
|
88
88
|
"vite": "7.3.1",
|
|
89
89
|
"vitest": "4.0.18"
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"access": "public"
|
|
109
109
|
},
|
|
110
110
|
"sideEffect": false,
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "5ccfbd65c727dda6c5e119e5164d4af6916d83bb"
|
|
112
112
|
}
|
package/src/config/imports.ts
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
|
+
import { interopDefault } from '@w5s/dev';
|
|
1
2
|
import { PluginOptionsBase, StylisticConfig, type Config } from '../type.js';
|
|
2
|
-
import type
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import importPlugin from 'eslint-plugin-import';
|
|
5
|
-
|
|
6
|
-
const importConfig = importPlugin.flatConfigs['recommended'];
|
|
3
|
+
import { type RuleOptions } from '../typegen/import.js';
|
|
7
4
|
|
|
8
5
|
export async function imports(options: imports.Options = {}) {
|
|
9
6
|
const { rules = {}, stylistic = true } = options;
|
|
10
7
|
const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
|
|
8
|
+
const [importPlugin] = await Promise.all([interopDefault(import('eslint-plugin-import'))] as const);
|
|
11
9
|
return [
|
|
12
10
|
{
|
|
13
11
|
name: 'w5s/import/rules',
|
|
14
|
-
plugins:
|
|
12
|
+
plugins: {
|
|
13
|
+
import: importPlugin,
|
|
14
|
+
},
|
|
15
15
|
rules: {
|
|
16
|
-
|
|
16
|
+
// 'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
17
|
+
'import/first': 'error',
|
|
18
|
+
'import/no-duplicates': 'error',
|
|
19
|
+
'import/no-mutable-exports': 'error',
|
|
20
|
+
'import/no-named-default': 'error',
|
|
21
|
+
|
|
17
22
|
...(stylisticEnabled
|
|
18
23
|
? {
|
|
19
24
|
// Stylistic rules
|
|
25
|
+
'import/newline-after-import': ['error', { count: 1 }],
|
|
20
26
|
}
|
|
21
27
|
: {}),
|
|
22
28
|
...rules,
|
package/src/config/jsdoc.ts
CHANGED
|
@@ -3,9 +3,7 @@ import { StylisticConfig, type PluginOptionsBase, type Config } from '../type.js
|
|
|
3
3
|
import type { RuleOptions } from '../typegen/jsdoc.js';
|
|
4
4
|
|
|
5
5
|
export async function jsdoc(options: jsdoc.Options = {}): Promise<readonly Config[]> {
|
|
6
|
-
const [jsdocPlugin] = await Promise.all([
|
|
7
|
-
interopDefault(import('eslint-plugin-jsdoc')),
|
|
8
|
-
] as const);
|
|
6
|
+
const [jsdocPlugin] = await Promise.all([interopDefault(import('eslint-plugin-jsdoc'))] as const);
|
|
9
7
|
const { rules = {}, stylistic = true } = options;
|
|
10
8
|
const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
|
|
11
9
|
|
|
@@ -19,20 +17,21 @@ export async function jsdoc(options: jsdoc.Options = {}): Promise<readonly Confi
|
|
|
19
17
|
{
|
|
20
18
|
name: 'w5s/jsdoc/rules',
|
|
21
19
|
rules: {
|
|
22
|
-
...
|
|
20
|
+
...jsdocPlugin.configs['flat/recommended-typescript-flavor'].rules,
|
|
23
21
|
'jsdoc/no-undefined-types': 'off', // https://github.com/gajus/eslint-plugin-jsdoc/issues/839
|
|
24
22
|
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
|
|
25
23
|
'jsdoc/require-jsdoc': 'off',
|
|
26
24
|
'jsdoc/require-param-description': 'off',
|
|
25
|
+
'jsdoc/require-param-type': 'off',
|
|
27
26
|
'jsdoc/require-returns': 'off',
|
|
28
|
-
'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }],
|
|
29
27
|
'jsdoc/valid-types': 'off', // FIXME: reports lots of false positive
|
|
30
28
|
// 'strict': ['error', 'safe'],
|
|
31
29
|
...(stylisticEnabled
|
|
32
30
|
? {
|
|
33
|
-
|
|
31
|
+
...jsdocPlugin.configs['flat/stylistic-typescript'].rules,
|
|
34
32
|
'jsdoc/check-alignment': 'warn',
|
|
35
33
|
'jsdoc/multiline-blocks': 'warn',
|
|
34
|
+
'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }],
|
|
36
35
|
}
|
|
37
36
|
: {}),
|
|
38
37
|
...rules,
|
package/src/typegen/jsdoc.d.ts
CHANGED