@w5s/eslint-config 3.36.0 → 3.40.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "3.36.0",
3
+ "version": "3.40.0",
4
4
  "description": "ESLint configuration presets",
5
5
  "keywords": [
6
6
  "eslint",
@@ -37,21 +37,21 @@
37
37
  "postpack": "clean-package restore"
38
38
  },
39
39
  "dependencies": {
40
- "@e18e/eslint-plugin": "^0.8.0",
41
- "@eslint-react/eslint-plugin": "5.18.7",
42
- "@eslint/js": "^10.0.0",
43
- "@eslint/markdown": "^8.0.0",
44
- "@next/eslint-plugin-next": "^16.0.0",
45
- "@stylistic/eslint-plugin": "^5.0.0",
46
- "@typescript-eslint/eslint-plugin": "^8.0.0",
47
- "@typescript-eslint/parser": "^8.0.0",
40
+ "@e18e/eslint-plugin": "~0.8.0",
41
+ "@eslint-react/eslint-plugin": "~5.19.0",
42
+ "@eslint/js": "~10.0.0",
43
+ "@eslint/markdown": "~8.0.0",
44
+ "@next/eslint-plugin-next": "~16.3.0",
45
+ "@stylistic/eslint-plugin": "~5.10.0",
46
+ "@typescript-eslint/eslint-plugin": "~8.70.0",
47
+ "@typescript-eslint/parser": "^8.65.0",
48
48
  "@vitest/eslint-plugin": "~1.6.20",
49
- "@w5s/dev": "^3.27.0",
50
- "@w5s/eslint-config-ignore": "^1.26.0",
51
- "@w5s/prettier-config": "^3.21.0",
49
+ "@w5s/dev": "^3.31.0",
50
+ "@w5s/eslint-config-ignore": "^1.30.0",
51
+ "@w5s/prettier-config": "^3.25.0",
52
52
  "eslint-merge-processors": "^2.0.0",
53
53
  "eslint-plugin-import": "~2.32.0",
54
- "eslint-plugin-jsdoc": "~64.3.0",
54
+ "eslint-plugin-jsdoc": "~64.4.0",
55
55
  "eslint-plugin-jsonc": "~3.4.0",
56
56
  "eslint-plugin-n": "~18.3.0",
57
57
  "eslint-plugin-perfectionist": "~5.11.0",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "f01e374782fdf338f411115d7e82a0353540282b"
88
+ "gitHead": "c775b53274c35cb97edaa9ffa5cd5ffd47f9a4f0"
89
89
  }
@@ -120,7 +120,6 @@ function sortPackageJson() {
120
120
  'simple-git-hooks', // Key sort using git hook sort
121
121
  'pre-commit',
122
122
  'commitlint',
123
- 'lint-staged',
124
123
  'config',
125
124
  'nodemonConfig',
126
125
  'browserify',
@@ -8,7 +8,7 @@ import { withDefaultFiles } from '../internal/withDefaultFiles.js';
8
8
  import { looseRules } from '../rules/looseRules.js';
9
9
  import { type Config, type PluginOptionsBase, StylisticConfig } from '../type.js';
10
10
 
11
- const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['markdown']))}`];
11
+ const defaultFiles = [Project.extensionsToGlob(Project.queryExtensions(['markdown']), { nested: true })];
12
12
 
13
13
  export async function markdown(options: markdown.Options = {}) {
14
14
  const [markdownPlugin] = await Promise.all([
@@ -7,10 +7,18 @@ import type { Config } from './type.js';
7
7
  import * as config from './config.js';
8
8
 
9
9
  export interface DefineConfigOptions extends config.ignores.Options {
10
+ /**
11
+ * Additional override config entries appended last.
12
+ *
13
+ * Overrides are always applied at the end of the final config array so they
14
+ * win over the base preset and any todo layers.
15
+ */
16
+ overrides?: Array<Config> | undefined;
17
+
10
18
  /**
11
19
  * Plugins configuration
12
20
  */
13
- plugins?: {
21
+ plugins?: undefined | {
14
22
  'e18e'?: boolean | config.e18e.Options | undefined;
15
23
  'es'?: boolean | config.es.Options | undefined;
16
24
  'import'?: boolean | config.imports.Options | undefined;
@@ -33,11 +41,18 @@ export interface DefineConfigOptions extends config.ignores.Options {
33
41
  /**
34
42
  * Override rules
35
43
  */
36
- rules?: eslint.Linter.RulesRecord;
44
+ rules?: eslint.Linter.RulesRecord | undefined;
45
+
46
+ /**
47
+ * Additional config entries appended after the base configuration.
48
+ *
49
+ * They are meant to be temporary rules overrides that need a fix
50
+ */
51
+ todo?: Array<Config> | undefined;
37
52
  }
38
53
 
39
54
  export async function defineConfig(options: DefineConfigOptions = {}): Promise<Array<Config>> {
40
- const { plugins = {}, rules } = options;
55
+ const { overrides = [], plugins = {}, rules, todo = [] } = options;
41
56
  const stylisticOptions =
42
57
  typeof plugins.stylistic === 'boolean' ? { enabled: plugins.stylistic } : { enabled: true, ...plugins.stylistic };
43
58
  const withDefaultStylistic = <T>(_options: T) => ({ stylistic: stylisticOptions, ..._options });
@@ -66,6 +81,7 @@ export async function defineConfig(options: DefineConfigOptions = {}): Promise<A
66
81
  ...includeEnabled(config.e18e, toOption(plugins.e18e)),
67
82
  ...includeEnabled(config.jsx, toOption(plugins.jsx)),
68
83
  ...includeEnabled(config.unusedImports, toOption(plugins['unused-imports'])),
84
+ ...includeEnabled(config.jsdoc, toOption(plugins.jsdoc)),
69
85
  ...includeEnabled(config.imports, toOption(plugins.import)),
70
86
  ...includeEnabled(config.perfectionist, toOption(plugins.perfectionist)),
71
87
  ...includeEnabled(config.node, toOption(plugins.node)),
@@ -78,9 +94,10 @@ export async function defineConfig(options: DefineConfigOptions = {}): Promise<A
78
94
 
79
95
  // other languages
80
96
  ...includeEnabled(config.jsonc, toOption(plugins.jsonc)),
81
- ...includeEnabled(config.jsdoc, toOption(plugins.jsdoc)),
82
97
  ...includeEnabled(config.markdown, toOption(plugins.markdown)),
83
98
  ...includeEnabled(config.yml, toOption(plugins.yml)),
84
99
  ...(rules ? [{ rules }] : []),
100
+ ...todo,
101
+ ...overrides,
85
102
  );
86
103
  }
package/src/glob.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { Project } from '@w5s/dev';
2
2
 
3
- export const sourceGlob = `**/${Project.extensionsToGlob(Project.sourceExtensions())}`;
3
+ export const sourceGlob = Project.extensionsToGlob(Project.sourceExtensions(), { nested: true });
4
4
 
5
- export const esSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['javascript', 'javascriptreact']))}`;
5
+ export const esSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['javascript', 'javascriptreact']), { nested: true });
6
6
 
7
- export const jsxSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['javascriptreact', 'typescriptreact']))}`;
7
+ export const jsxSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['javascriptreact', 'typescriptreact']), { nested: true });
8
8
 
9
- export const jsonSourceGlob = `**/${Project.extensionsToGlob(['.json', '.json5', '.jsonc'])}`;
9
+ export const jsonSourceGlob = Project.extensionsToGlob(['.json', '.json5', '.jsonc'], { nested: true });
10
10
 
11
- export const tsSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['typescript', 'typescriptreact']))}`;
11
+ export const tsSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['typescript', 'typescriptreact']), { nested: true });
12
12
 
13
- export const ymlSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['yaml']))}`;
13
+ export const ymlSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['yaml']), { nested: true });
@@ -739,6 +739,8 @@ type JsdocNoUnnecessaryTypeAssertion = []|[{
739
739
 
740
740
  enableFixer?: boolean
741
741
 
742
+ preferConstToLiteralTuples?: boolean
743
+
742
744
  treatAnyAsRedundant?: boolean
743
745
 
744
746
  typesToIgnore?: string[]
@@ -79,6 +79,11 @@ export interface RuleOptions {
79
79
  * @see https://nextjs.org/docs/messages/no-img-element
80
80
  */
81
81
  'next/no-img-element'?: Linter.RuleEntry<[]>
82
+ /**
83
+ * Prevent usage of `location.assign` or `location.href` assignment to navigate to internal Next.js pages.
84
+ * @see https://nextjs.org/docs/messages/no-location-assign-relative-destination
85
+ */
86
+ 'next/no-location-assign-relative-destination'?: Linter.RuleEntry<[]>
82
87
  /**
83
88
  * Prevent page-only custom fonts.
84
89
  * @see https://nextjs.org/docs/messages/no-page-custom-font
@@ -105,7 +105,7 @@ export interface RuleOptions {
105
105
  */
106
106
  'react/globals'?: Linter.RuleEntry<[]>
107
107
  /**
108
- * Validates against passing functions that mutate captured local variables into frozen contexts such as JSX props, hook arguments, and hook return values.
108
+ * Validates against mutating props, state, and other immutable values, including through functions passed into frozen contexts such as JSX props, hook arguments, and hook return values.
109
109
  * @see https://eslint-react.xyz/docs/rules/immutability
110
110
  */
111
111
  'react/immutability'?: Linter.RuleEntry<[]>
@@ -460,7 +460,7 @@ export interface RuleOptions {
460
460
  */
461
461
  'react/x-globals'?: Linter.RuleEntry<[]>
462
462
  /**
463
- * Validates against passing functions that mutate captured local variables into frozen contexts such as JSX props, hook arguments, and hook return values.
463
+ * Validates against mutating props, state, and other immutable values, including through functions passed into frozen contexts such as JSX props, hook arguments, and hook return values.
464
464
  * @see https://eslint-react.xyz/docs/rules/immutability
465
465
  */
466
466
  'react/x-immutability'?: Linter.RuleEntry<[]>
@@ -220,6 +220,11 @@ export interface RuleOptions {
220
220
  * @see https://typescript-eslint.io/rules/no-for-in-array
221
221
  */
222
222
  'ts/no-for-in-array'?: Linter.RuleEntry<[]>
223
+ /**
224
+ * Disallow type operations that resolve to the "empty object" type
225
+ * @see https://typescript-eslint.io/rules/no-generated-empty-object-type
226
+ */
227
+ 'ts/no-generated-empty-object-type'?: Linter.RuleEntry<[]>
223
228
  /**
224
229
  * Disallow the use of `eval()`-like functions
225
230
  * @see https://typescript-eslint.io/rules/no-implied-eval
@@ -1356,7 +1361,10 @@ type TsNoMeaninglessVoidOperator = []|[{
1356
1361
  // ----- ts/no-misused-promises -----
1357
1362
  type TsNoMisusedPromises = []|[{
1358
1363
 
1359
- checksConditionals?: boolean
1364
+ checksConditionals?: (boolean | {
1365
+
1366
+ flagUnions?: ("all" | "strict" | "none")
1367
+ })
1360
1368
 
1361
1369
  checksSpreads?: boolean
1362
1370