@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "3.3.1",
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.3",
65
+ "@w5s/dev": "^3.1.4",
66
66
  "@w5s/prettier-config": "^3.0.5",
67
- "eslint-plugin-import": "^2.25.0",
68
- "eslint-plugin-jsdoc": "^62.0.0",
69
- "eslint-plugin-jsonc": "^2.4.0",
70
- "eslint-plugin-n": "^17.0.0",
71
- "eslint-plugin-unicorn": "^62.0.0",
72
- "eslint-plugin-yml": "^2.0.0",
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.0",
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": "550810ad9a8d35378bb00361cd0080bd67058fc5"
111
+ "gitHead": "5ccfbd65c727dda6c5e119e5164d4af6916d83bb"
112
112
  }
@@ -1,22 +1,28 @@
1
+ import { interopDefault } from '@w5s/dev';
1
2
  import { PluginOptionsBase, StylisticConfig, type Config } from '../type.js';
2
- import type { RuleOptions } from '../typegen/import.js';
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: importConfig.plugins ?? {},
12
+ plugins: {
13
+ import: importPlugin,
14
+ },
15
15
  rules: {
16
- ...(importConfig?.rules),
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,
@@ -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
- ...(jsdocPlugin.configs['flat/recommended'].rules),
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
- // ...(jsdocPlugin.configs['flat/stylistic'].rules),
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,
@@ -3,10 +3,12 @@ import type { StylisticParameters } from './StylisticConfig.js';
3
3
 
4
4
  export interface PluginOptionsBase<Rules> {
5
5
  files?: Linter.Config['files'];
6
+
6
7
  /**
7
8
  * Plugin rules
8
9
  */
9
10
  rules?: Rules;
11
+
10
12
  /**
11
13
  * Stylistic options
12
14
  */
@@ -1082,6 +1082,8 @@ type JsdocTagLines = []|[("always" | "any" | "never")]|[("always" | "any" | "nev
1082
1082
 
1083
1083
  startLines?: (number | null)
1084
1084
 
1085
+ startLinesWithNoTags?: number
1086
+
1085
1087
  tags?: {
1086
1088
  [k: string]: {
1087
1089
  count?: number