@luxass/eslint-config 5.2.5 → 5.3.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/dist/index.d.ts CHANGED
@@ -43,6 +43,9 @@ interface AstroOptions {
43
43
  }
44
44
  declare function astro(options?: AstroOptions): Promise<TypedFlatConfigItem[]>;
45
45
  //#endregion
46
+ //#region src/configs/command.d.ts
47
+ declare function command(): Promise<TypedFlatConfigItem[]>;
48
+ //#endregion
46
49
  //#region src/configs/comments.d.ts
47
50
  declare function comments(): Promise<TypedFlatConfigItem[]>;
48
51
  //#endregion
@@ -988,6 +991,11 @@ interface RuleOptions {
988
991
  * @deprecated
989
992
  */
990
993
  'comma-style'?: Linter.RuleEntry<CommaStyle>;
994
+ /**
995
+ * Comment-as-command for one-off codemod with ESLint
996
+ * @see https://github.com/antfu/eslint-plugin-command
997
+ */
998
+ 'command/command'?: Linter.RuleEntry<[]>;
991
999
  /**
992
1000
  * Enforce a maximum cyclomatic complexity allowed in a program
993
1001
  * @see https://eslint.org/docs/latest/rules/complexity
@@ -3171,6 +3179,31 @@ interface RuleOptions {
3171
3179
  * @see https://perfectionist.dev/rules/sort-variable-declarations
3172
3180
  */
3173
3181
  'perfectionist/sort-variable-declarations'?: Linter.RuleEntry<PerfectionistSortVariableDeclarations>;
3182
+ /**
3183
+ * Enforce using "catalog:" in `package.json`
3184
+ * @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/json/json-enforce-catalog.test.ts
3185
+ */
3186
+ 'pnpm/json-enforce-catalog'?: Linter.RuleEntry<PnpmJsonEnforceCatalog>;
3187
+ /**
3188
+ * Prefer having pnpm settings in `pnpm-workspace.yaml` instead of `package.json`. This would requires pnpm v10.6+, see https://github.com/orgs/pnpm/discussions/9037.
3189
+ * @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/json/json-prefer-workspace-settings.test.ts
3190
+ */
3191
+ 'pnpm/json-prefer-workspace-settings'?: Linter.RuleEntry<PnpmJsonPreferWorkspaceSettings>;
3192
+ /**
3193
+ * Enforce using valid catalog in `package.json`
3194
+ * @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/json/json-valid-catalog.test.ts
3195
+ */
3196
+ 'pnpm/json-valid-catalog'?: Linter.RuleEntry<PnpmJsonValidCatalog>;
3197
+ /**
3198
+ * Disallow unused catalogs in `pnpm-workspace.yaml`
3199
+ * @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/yaml/yaml-no-duplicate-catalog-item.test.ts
3200
+ */
3201
+ 'pnpm/yaml-no-duplicate-catalog-item'?: Linter.RuleEntry<PnpmYamlNoDuplicateCatalogItem>;
3202
+ /**
3203
+ * Disallow unused catalogs in `pnpm-workspace.yaml`
3204
+ * @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/yaml/yaml-no-unused-catalog-item.test.ts
3205
+ */
3206
+ 'pnpm/yaml-no-unused-catalog-item'?: Linter.RuleEntry<[]>;
3174
3207
  /**
3175
3208
  * Require using arrow functions for callbacks
3176
3209
  * @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
@@ -6655,7 +6688,7 @@ interface RuleOptions {
6655
6688
  * Order of UnoCSS utilities in class attribute
6656
6689
  * @see https://unocss.dev/integrations/eslint#rules
6657
6690
  */
6658
- 'unocss/order'?: Linter.RuleEntry<[]>;
6691
+ 'unocss/order'?: Linter.RuleEntry<UnocssOrder>;
6659
6692
  /**
6660
6693
  * Order of UnoCSS attributes
6661
6694
  * @see https://unocss.dev/integrations/eslint#rules
@@ -9964,10 +9997,17 @@ type NoRestrictedExports = [] | [({
9964
9997
  };
9965
9998
  })];
9966
9999
  // ----- no-restricted-globals -----
9967
- type NoRestrictedGlobals = (string | {
10000
+ type NoRestrictedGlobals = ((string | {
9968
10001
  name: string;
9969
10002
  message?: string;
9970
- })[];
10003
+ })[] | [] | [{
10004
+ globals: (string | {
10005
+ name: string;
10006
+ message?: string;
10007
+ })[];
10008
+ checkGlobalObject?: boolean;
10009
+ globalObjects?: string[];
10010
+ }]);
9971
10011
  // ----- no-restricted-imports -----
9972
10012
  type NoRestrictedImports = ((string | {
9973
10013
  name: string;
@@ -10462,6 +10502,8 @@ type OneVar = [] | [(("always" | "never" | "consecutive") | {
10462
10502
  var?: ("always" | "never" | "consecutive");
10463
10503
  let?: ("always" | "never" | "consecutive");
10464
10504
  const?: ("always" | "never" | "consecutive");
10505
+ using?: ("always" | "never" | "consecutive");
10506
+ awaitUsing?: ("always" | "never" | "consecutive");
10465
10507
  } | {
10466
10508
  initialized?: ("always" | "never" | "consecutive");
10467
10509
  uninitialized?: ("always" | "never" | "consecutive");
@@ -12209,6 +12251,31 @@ type PerfectionistSortVariableDeclarations = [] | [{
12209
12251
  commentAbove?: string;
12210
12252
  })[];
12211
12253
  }];
12254
+ // ----- pnpm/json-enforce-catalog -----
12255
+ type PnpmJsonEnforceCatalog = [] | [{
12256
+ allowedProtocols?: string[];
12257
+ autofix?: boolean;
12258
+ defaultCatalog?: string;
12259
+ reuseExistingCatalog?: boolean;
12260
+ conflicts?: ("new-catalog" | "overrides" | "error");
12261
+ fields?: string[];
12262
+ }];
12263
+ // ----- pnpm/json-prefer-workspace-settings -----
12264
+ type PnpmJsonPreferWorkspaceSettings = [] | [{
12265
+ autofix?: boolean;
12266
+ }];
12267
+ // ----- pnpm/json-valid-catalog -----
12268
+ type PnpmJsonValidCatalog = [] | [{
12269
+ autoInsert?: boolean;
12270
+ autoInsertDefaultSpecifier?: string;
12271
+ autofix?: boolean;
12272
+ enforceNoConflict?: boolean;
12273
+ fields?: unknown[];
12274
+ }];
12275
+ // ----- pnpm/yaml-no-duplicate-catalog-item -----
12276
+ type PnpmYamlNoDuplicateCatalogItem = [] | [{
12277
+ allow?: string[];
12278
+ }];
12212
12279
  // ----- prefer-arrow-callback -----
12213
12280
  type PreferArrowCallback = [] | [{
12214
12281
  allowNamedFunctions?: boolean;
@@ -15169,6 +15236,12 @@ type UnocssEnforceClassCompile = [] | [{
15169
15236
  prefix?: string;
15170
15237
  enableFix?: boolean;
15171
15238
  }];
15239
+ // ----- unocss/order -----
15240
+ type UnocssOrder = [] | [{
15241
+ unoFunctions?: string[];
15242
+ unoVariables?: string[];
15243
+ [k: string]: unknown | undefined;
15244
+ }];
15172
15245
  // ----- unused-imports/no-unused-imports -----
15173
15246
  type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
15174
15247
  args?: ("all" | "after-used" | "none");
@@ -16604,7 +16677,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
16604
16677
  onlyEquality?: boolean;
16605
16678
  }];
16606
16679
  // Names of all the configs
16607
- type ConfigNames = 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/eslint-comments' | 'luxass/formatter/setup' | 'luxass/imports' | 'luxass/javascript/setup' | 'luxass/javascript/rules' | 'luxass/disables/cli' | 'luxass/jsdoc/rules' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/disables' | 'luxass/node' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/sort/package-json' | 'luxass/perfectionist/setup' | 'luxass/stylistic' | 'luxass/tailwindcss' | 'luxass/sort/tsconfig' | 'luxass/ignores' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/typescript/setup' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/unicorn/rules' | 'luxass/unocss' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/pnpm-workspace' | 'luxass/disables/scripts' | 'luxass/disables/cli' | 'luxass/disables/bin' | 'luxass/disables/dts' | 'luxass/disables/cjs' | 'luxass/disables/github-actions' | 'luxass/disables/config-files' | 'luxass/jsx/setup' | 'luxass/regexp/rules';
16680
+ type ConfigNames = 'luxass/astro/setup' | 'luxass/astro/rules' | 'command' | 'luxass/eslint-comments' | 'luxass/disables/scripts' | 'luxass/disables/cli' | 'luxass/disables/bin' | 'luxass/disables/dts' | 'luxass/disables/cjs' | 'luxass/disables/github-actions' | 'luxass/disables/config-files' | 'luxass/formatter/setup' | 'luxass/ignores' | 'luxass/imports' | 'luxass/javascript/setup' | 'luxass/javascript/rules' | 'luxass/disables/cli' | 'luxass/jsdoc/rules' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/jsx/setup' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/disables' | 'luxass/node' | 'luxass/perfectionist/setup' | 'luxass/pnpm/package-json' | 'luxass/pnpm/pnpm-workspace-yaml' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/regexp/rules' | 'luxass/sort/package-json' | 'luxass/sort/tsconfig' | 'luxass/stylistic' | 'luxass/tailwindcss' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/typescript/setup' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/unicorn/rules' | 'luxass/unocss' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/pnpm-workspace';
16608
16681
  //#endregion
16609
16682
  //#region src/types.d.ts
16610
16683
  type Awaitable<T> = T | Promise<T>;
@@ -17017,4 +17090,4 @@ declare function isPackageInScope(name: string): boolean;
17017
17090
  declare function isInEditorEnv(): boolean;
17018
17091
  declare function isInGitHooksOrLintStaged(): boolean;
17019
17092
  //#endregion
17020
- export { AstroOptions, Awaitable, type ConfigNames, ConfigOptions, FormattersOptions, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, ImportsOptions, JSDOCOptions, JSONOptions, JavaScriptOptions, MarkdownOptions, ProjectType, ReactOptions, RegExpOptions, ResolvedOptions, Rules, StylisticConfig, StylisticOptions, TOMLOptions, TailwindCSSOptions, TestOptions, TypeScriptOptions, TypedFlatConfigItem, UnicornOptions, UnoCSSOptions, UserConfigItem, VueOptions, YAMLOptions, astro, combine, comments, luxass as default, luxass, disables, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
17093
+ export { AstroOptions, Awaitable, type ConfigNames, ConfigOptions, FormattersOptions, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, ImportsOptions, JSDOCOptions, JSONOptions, JavaScriptOptions, MarkdownOptions, ProjectType, ReactOptions, RegExpOptions, ResolvedOptions, Rules, StylisticConfig, StylisticOptions, TOMLOptions, TailwindCSSOptions, TestOptions, TypeScriptOptions, TypedFlatConfigItem, UnicornOptions, UnoCSSOptions, UserConfigItem, VueOptions, YAMLOptions, astro, combine, command, comments, luxass as default, luxass, disables, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
2
2
  import { isPackageExists } from "local-pkg";
3
3
  import process from "node:process";
4
4
  import { fileURLToPath } from "node:url";
5
+ import createCommand from "eslint-plugin-command/config";
5
6
  import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
6
7
  import pluginAntfu from "eslint-plugin-antfu";
7
8
  import pluginImportLite from "eslint-plugin-import-lite";
@@ -349,6 +350,15 @@ async function astro(options = {}) {
349
350
  }];
350
351
  }
351
352
 
353
+ //#endregion
354
+ //#region src/configs/command.ts
355
+ async function command() {
356
+ return [{
357
+ name: "luxass/command/rules",
358
+ ...createCommand()
359
+ }];
360
+ }
361
+
352
362
  //#endregion
353
363
  //#region src/configs/comments.ts
354
364
  async function comments() {
@@ -2123,7 +2133,8 @@ function luxass(options = {}, ...userConfigs) {
2123
2133
  configs$1.push(ignores(), javascript({
2124
2134
  isInEditor,
2125
2135
  overrides: getOverrides(options, "javascript")
2126
- }), comments(), node(), jsdoc({ stylistic: stylisticOptions }), imports({ stylistic: stylisticOptions }), perfectionist());
2136
+ }), comments());
2137
+ configs$1.push(node(), jsdoc({ stylistic: stylisticOptions }), imports({ stylistic: stylisticOptions }), command(), perfectionist());
2127
2138
  if (enableImports) configs$1.push(imports(enableImports === true ? { stylistic: stylisticOptions } : {
2128
2139
  stylistic: stylisticOptions,
2129
2140
  ...enableImports
@@ -2208,4 +2219,4 @@ function luxass(options = {}, ...userConfigs) {
2208
2219
  var src_default = luxass;
2209
2220
 
2210
2221
  //#endregion
2211
- export { GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, combine, comments, src_default as default, disables, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, luxass, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
2222
+ export { GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, combine, command, comments, src_default as default, disables, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, luxass, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "5.2.5",
3
+ "version": "5.3.0",
4
4
  "description": "ESLint config for @luxass",
5
5
  "type": "module",
6
6
  "author": {
@@ -84,21 +84,22 @@
84
84
  "@clack/prompts": "^0.11.0",
85
85
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
86
86
  "@eslint/markdown": "^7.1.0",
87
- "@stylistic/eslint-plugin": "^5.2.2",
88
- "@typescript-eslint/eslint-plugin": "^8.38.0",
89
- "@typescript-eslint/parser": "^8.38.0",
87
+ "@stylistic/eslint-plugin": "^5.2.3",
88
+ "@typescript-eslint/eslint-plugin": "^8.39.0",
89
+ "@typescript-eslint/parser": "^8.39.0",
90
90
  "@vitest/eslint-plugin": "^1.3.4",
91
91
  "eslint-config-flat-gitignore": "^2.1.0",
92
92
  "eslint-flat-config-utils": "^2.1.1",
93
93
  "eslint-merge-processors": "^2.0.0",
94
94
  "eslint-plugin-antfu": "^3.1.1",
95
+ "eslint-plugin-command": "^3.3.1",
95
96
  "eslint-plugin-import-lite": "^0.3.0",
96
- "eslint-plugin-jsdoc": "^52.0.1",
97
+ "eslint-plugin-jsdoc": "^52.0.4",
97
98
  "eslint-plugin-jsonc": "^2.20.1",
98
99
  "eslint-plugin-n": "^17.21.3",
99
100
  "eslint-plugin-perfectionist": "^4.15.0",
100
101
  "eslint-plugin-pnpm": "^1.1.0",
101
- "eslint-plugin-regexp": "^2.9.0",
102
+ "eslint-plugin-regexp": "^2.10.0",
102
103
  "eslint-plugin-toml": "^0.12.0",
103
104
  "eslint-plugin-unicorn": "^60.0.0",
104
105
  "eslint-plugin-unused-imports": "^4.1.4",
@@ -116,11 +117,11 @@
116
117
  "devDependencies": {
117
118
  "@eslint-react/eslint-plugin": "^1.52.3",
118
119
  "@eslint/config-inspector": "^1.1.0",
119
- "@types/node": "^22.13.10",
120
- "@typescript-eslint/rule-tester": "^8.38.0",
121
- "@unocss/eslint-plugin": "^66.3.3",
120
+ "@types/node": "^22.17.1",
121
+ "@typescript-eslint/rule-tester": "^8.39.0",
122
+ "@unocss/eslint-plugin": "^66.4.2",
122
123
  "astro-eslint-parser": "^1.2.2",
123
- "eslint": "^9.32.0",
124
+ "eslint": "^9.33.0",
124
125
  "eslint-plugin-astro": "^1.3.1",
125
126
  "eslint-plugin-format": "^1.0.1",
126
127
  "eslint-plugin-react-hooks": "^5.2.0",
@@ -130,10 +131,10 @@
130
131
  "jiti": "^2.5.1",
131
132
  "prettier-plugin-astro": "^0.14.1",
132
133
  "tailwindcss": "3.4.17",
133
- "tsdown": "^0.13.0",
134
+ "tsdown": "^0.13.4",
134
135
  "tsx": "^4.20.3",
135
- "typescript": "^5.8.3",
136
- "unocss": "^66.3.3",
136
+ "typescript": "^5.9.2",
137
+ "unocss": "^66.4.2",
137
138
  "vitest": "^3.2.4",
138
139
  "vue": "^3.5.18"
139
140
  },