@storm-software/eslint 0.170.167 → 0.170.168
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.cjs +25 -1
- package/dist/index.d.cts +78 -2
- package/dist/index.d.mts +78 -2
- package/dist/index.mjs +25 -2
- package/package.json +13 -10
package/dist/index.cjs
CHANGED
|
@@ -11663,6 +11663,28 @@ async function reactNative(options = {}) {
|
|
|
11663
11663
|
}];
|
|
11664
11664
|
}
|
|
11665
11665
|
//#endregion
|
|
11666
|
+
//#region src/configs/react-query.ts
|
|
11667
|
+
/**
|
|
11668
|
+
* Config for TanStack Query ESLint plugin.
|
|
11669
|
+
*
|
|
11670
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
11671
|
+
*/
|
|
11672
|
+
async function reactQuery(options = {}) {
|
|
11673
|
+
const { strict = false, overrides = {} } = options;
|
|
11674
|
+
await ensurePackages(["@tanstack/eslint-plugin-query"]);
|
|
11675
|
+
const pluginQuery = await interopDefault(import("@tanstack/eslint-plugin-query"));
|
|
11676
|
+
const configKey = strict ? "flat/recommended-strict" : "flat/recommended";
|
|
11677
|
+
const [config] = pluginQuery.configs[configKey];
|
|
11678
|
+
return [{
|
|
11679
|
+
...config,
|
|
11680
|
+
name: "storm/react-query/rules",
|
|
11681
|
+
rules: {
|
|
11682
|
+
...config?.rules ?? {},
|
|
11683
|
+
...overrides
|
|
11684
|
+
}
|
|
11685
|
+
}];
|
|
11686
|
+
}
|
|
11687
|
+
//#endregion
|
|
11666
11688
|
//#region src/configs/regexp.ts
|
|
11667
11689
|
async function regexp(options = {}) {
|
|
11668
11690
|
const config = eslint_plugin_regexp.configs["flat/recommended"];
|
|
@@ -12517,7 +12539,7 @@ function getOverrides(options, key) {
|
|
|
12517
12539
|
* @param userConfigs - Additional ESLint configurations.
|
|
12518
12540
|
*/
|
|
12519
12541
|
function preset(options, ...userConfigs) {
|
|
12520
|
-
const { name, globals = {}, banner: enableBanner = true, astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, mdx: enableMdx = false, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, typescript: enableTypeScript = (0, local_pkg.isPackageExists)("typescript"), unicorn: enableUnicorn = true, jsdoc: enableJSDoc = false, tsdoc: enableTSDoc = true, test: enableTest = true, unocss: enableUnoCSS = false, zod: enableZod = false, bun: enableBun, pnpm: enablePnpm } = options;
|
|
12542
|
+
const { name, globals = {}, banner: enableBanner = true, astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, mdx: enableMdx = false, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, "react-query": enableReactQuery = false, typescript: enableTypeScript = (0, local_pkg.isPackageExists)("typescript"), unicorn: enableUnicorn = true, jsdoc: enableJSDoc = false, tsdoc: enableTSDoc = true, test: enableTest = true, unocss: enableUnoCSS = false, zod: enableZod = false, bun: enableBun, pnpm: enablePnpm } = options;
|
|
12521
12543
|
const packageManager = detectPackageManager();
|
|
12522
12544
|
let isInEditor = options.isInEditor;
|
|
12523
12545
|
if (!isInEditor) {
|
|
@@ -12596,6 +12618,7 @@ function preset(options, ...userConfigs) {
|
|
|
12596
12618
|
}));
|
|
12597
12619
|
if (enableNext) configs.push(next(resolveSubOptions(options, "next")));
|
|
12598
12620
|
if (enableStorybook) configs.push(storybook(resolveSubOptions(options, "storybook")));
|
|
12621
|
+
if (enableReactQuery) configs.push(reactQuery(resolveSubOptions(options, "react-query")));
|
|
12599
12622
|
if (enableUnoCSS) configs.push(unocss({
|
|
12600
12623
|
...resolveSubOptions(options, "unocss"),
|
|
12601
12624
|
overrides: getOverrides(options, "unocss")
|
|
@@ -12682,6 +12705,7 @@ exports.preset = preset;
|
|
|
12682
12705
|
exports.prettier = prettier;
|
|
12683
12706
|
exports.react = react;
|
|
12684
12707
|
exports.reactNative = reactNative;
|
|
12708
|
+
exports.reactQuery = reactQuery;
|
|
12685
12709
|
exports.regexp = regexp;
|
|
12686
12710
|
exports.resolveSubOptions = resolveSubOptions;
|
|
12687
12711
|
exports.secrets = secrets;
|
package/dist/index.d.cts
CHANGED
|
@@ -511,6 +511,46 @@ Backward pagination arguments
|
|
|
511
511
|
* Checks common nx-plugin configuration files for validity
|
|
512
512
|
*/
|
|
513
513
|
'@nx/nx-plugin-checks'?: Linter.RuleEntry<NxNxPluginChecks>;
|
|
514
|
+
/**
|
|
515
|
+
* Exhaustive deps rule for useQuery
|
|
516
|
+
* @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
|
|
517
|
+
*/
|
|
518
|
+
'@tanstack/query/exhaustive-deps'?: Linter.RuleEntry<TanstackQueryExhaustiveDeps>;
|
|
519
|
+
/**
|
|
520
|
+
* Ensure correct order of inference sensitive properties for infinite queries
|
|
521
|
+
* @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
|
|
522
|
+
*/
|
|
523
|
+
'@tanstack/query/infinite-query-property-order'?: Linter.RuleEntry<[]>;
|
|
524
|
+
/**
|
|
525
|
+
* Ensure correct order of inference-sensitive properties in useMutation()
|
|
526
|
+
* @see https://tanstack.com/query/latest/docs/eslint/mutation-property-order
|
|
527
|
+
*/
|
|
528
|
+
'@tanstack/query/mutation-property-order'?: Linter.RuleEntry<[]>;
|
|
529
|
+
/**
|
|
530
|
+
* Disallows rest destructuring in queries
|
|
531
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
|
|
532
|
+
*/
|
|
533
|
+
'@tanstack/query/no-rest-destructuring'?: Linter.RuleEntry<[]>;
|
|
534
|
+
/**
|
|
535
|
+
* Disallow putting the result of query hooks directly in a React hook dependency array
|
|
536
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
|
|
537
|
+
*/
|
|
538
|
+
'@tanstack/query/no-unstable-deps'?: Linter.RuleEntry<[]>;
|
|
539
|
+
/**
|
|
540
|
+
* Ensures queryFn returns a non-undefined value
|
|
541
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
|
|
542
|
+
*/
|
|
543
|
+
'@tanstack/query/no-void-query-fn'?: Linter.RuleEntry<[]>;
|
|
544
|
+
/**
|
|
545
|
+
* Prefer using queryOptions() to co-locate queryKey and queryFn
|
|
546
|
+
* @see https://tanstack.com/query/latest/docs/eslint/prefer-query-options
|
|
547
|
+
*/
|
|
548
|
+
'@tanstack/query/prefer-query-options'?: Linter.RuleEntry<[]>;
|
|
549
|
+
/**
|
|
550
|
+
* Makes sure that QueryClient is stable
|
|
551
|
+
* @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
|
|
552
|
+
*/
|
|
553
|
+
'@tanstack/query/stable-query-client'?: Linter.RuleEntry<[]>;
|
|
514
554
|
/**
|
|
515
555
|
* Enforce getter and setter pairs in objects and classes
|
|
516
556
|
* @see https://eslint.org/docs/latest/rules/accessor-pairs
|
|
@@ -8305,6 +8345,13 @@ type NxNxPluginChecks = [] | [{
|
|
|
8305
8345
|
allowedVersionStrings?: string[];
|
|
8306
8346
|
tsConfig?: string;
|
|
8307
8347
|
}];
|
|
8348
|
+
// ----- @tanstack/query/exhaustive-deps -----
|
|
8349
|
+
type TanstackQueryExhaustiveDeps = [] | [{
|
|
8350
|
+
allowlist?: {
|
|
8351
|
+
variables?: string[];
|
|
8352
|
+
types?: string[];
|
|
8353
|
+
};
|
|
8354
|
+
}];
|
|
8308
8355
|
// ----- accessor-pairs -----
|
|
8309
8356
|
type AccessorPairs = [] | [{
|
|
8310
8357
|
getWithoutSet?: boolean;
|
|
@@ -16917,7 +16964,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16917
16964
|
onlyEquality?: boolean;
|
|
16918
16965
|
}];
|
|
16919
16966
|
// Names of all the configs
|
|
16920
|
-
type ConfigNames = "storm/banner" | "storm/bun/setup" | "bun/recommended/package-json" | "bun/recommended/package-json" | "storm/cspell/rules" | "storm/astro/setup" | "storm/astro/rules" | "storm/formatter/setup" | "storm/imports/rules" | "storm/graphql/setup" | "storm/graphql/rules" | "storm/graphql/relay" | "storm/javascript/setup" | "storm/javascript/rules" | "storm/jsx/rules" | "storm/jsdoc/rules" | "storm/jsonc/setup" | "storm/jsonc/rules" | "storm/markdown/setup" | "storm/markdown/rules" | "mdx/flat" | "storm/node/rules" | "storm/nx/setup" | "storm/nx/schema" | "storm/nx/dependency-check" | "storm/nx/module-boundaries" | "storm/next/rules" | "storm/prettier" | "storm/perfectionist/rules" | "storm/pnpm/setup" | "storm/pnpm/package-json" | "storm/pnpm/pnpm-workspace-yaml" | "storm/react/setup" | "storm/react/rules" | "storm/react-native/rules" | "storm/sort/package-json" | "storm/stylistic/rules" | "storm/secrets/rules" | "storm/storybook/setup" | "storm/storybook/rules" | "storm/storybook/main" | "storm/test/setup" | "storm/test/rules" | "storm/tsdoc/rules" | "storm/toml/setup" | "storm/toml/rules" | "storm/typescript/setup" | "storm/typescript/parser" | "storm/typescript/type-aware-parser" | "storm/typescript/rules" | "storm/typescript/rules-type-aware" | "storm/regexp/rules" | "storm/unicorn/rules" | "storm/unocss" | "storm/yaml/setup" | "storm/yaml/rules" | "storm/zod/rules";
|
|
16967
|
+
type ConfigNames = "storm/banner" | "storm/bun/setup" | "bun/recommended/package-json" | "bun/recommended/package-json" | "storm/cspell/rules" | "storm/astro/setup" | "storm/astro/rules" | "storm/formatter/setup" | "storm/imports/rules" | "storm/graphql/setup" | "storm/graphql/rules" | "storm/graphql/relay" | "storm/javascript/setup" | "storm/javascript/rules" | "storm/jsx/rules" | "storm/jsdoc/rules" | "storm/jsonc/setup" | "storm/jsonc/rules" | "storm/markdown/setup" | "storm/markdown/rules" | "mdx/flat" | "storm/node/rules" | "storm/nx/setup" | "storm/nx/schema" | "storm/nx/dependency-check" | "storm/nx/module-boundaries" | "storm/next/rules" | "storm/prettier" | "storm/perfectionist/rules" | "storm/pnpm/setup" | "storm/pnpm/package-json" | "storm/pnpm/pnpm-workspace-yaml" | "storm/react/setup" | "storm/react/rules" | "storm/react-native/rules" | "storm/react-query/rules" | "storm/sort/package-json" | "storm/stylistic/rules" | "storm/secrets/rules" | "storm/storybook/setup" | "storm/storybook/rules" | "storm/storybook/main" | "storm/test/setup" | "storm/test/rules" | "storm/tsdoc/rules" | "storm/toml/setup" | "storm/toml/rules" | "storm/typescript/setup" | "storm/typescript/parser" | "storm/typescript/type-aware-parser" | "storm/typescript/rules" | "storm/typescript/rules-type-aware" | "storm/regexp/rules" | "storm/unicorn/rules" | "storm/unocss" | "storm/yaml/setup" | "storm/yaml/rules" | "storm/zod/rules";
|
|
16921
16968
|
//#endregion
|
|
16922
16969
|
//#region src/vendor/prettier-types.d.ts
|
|
16923
16970
|
/**
|
|
@@ -17319,6 +17366,16 @@ interface OptionsStorybook extends OptionsOverrides {
|
|
|
17319
17366
|
*/
|
|
17320
17367
|
csf?: "none" | "loose" | "strict";
|
|
17321
17368
|
}
|
|
17369
|
+
interface OptionsReactQuery extends OptionsOverrides {
|
|
17370
|
+
/**
|
|
17371
|
+
* Use the strict recommended config, which enables additional opinionated rules.
|
|
17372
|
+
*
|
|
17373
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
17374
|
+
*
|
|
17375
|
+
* @defaultValue false
|
|
17376
|
+
*/
|
|
17377
|
+
strict?: boolean;
|
|
17378
|
+
}
|
|
17322
17379
|
interface OptionsReact extends OptionsOverrides {
|
|
17323
17380
|
/**
|
|
17324
17381
|
* Use a strict mode for React rules, which will enable more strict rules that may cause more false positives but can catch more potential issues.
|
|
@@ -17698,6 +17755,17 @@ interface OptionsConfig extends OptionsComponentExts, OptionsJavascript, Options
|
|
|
17698
17755
|
* @defaultValue false
|
|
17699
17756
|
*/
|
|
17700
17757
|
storybook?: boolean | OptionsStorybook;
|
|
17758
|
+
/**
|
|
17759
|
+
* Enable TanStack Query rules.
|
|
17760
|
+
*
|
|
17761
|
+
* Requires installing:
|
|
17762
|
+
* - `@tanstack/eslint-plugin-query`
|
|
17763
|
+
*
|
|
17764
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
17765
|
+
*
|
|
17766
|
+
* @defaultValue false
|
|
17767
|
+
*/
|
|
17768
|
+
"react-query"?: boolean | OptionsReactQuery;
|
|
17701
17769
|
/**
|
|
17702
17770
|
* Enable react rules.
|
|
17703
17771
|
*
|
|
@@ -17878,6 +17946,14 @@ declare function react(options?: OptionsComponentExts & Omit<OptionsTypeScriptPa
|
|
|
17878
17946
|
*/
|
|
17879
17947
|
declare function reactNative(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
17880
17948
|
//#endregion
|
|
17949
|
+
//#region src/configs/react-query.d.ts
|
|
17950
|
+
/**
|
|
17951
|
+
* Config for TanStack Query ESLint plugin.
|
|
17952
|
+
*
|
|
17953
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
17954
|
+
*/
|
|
17955
|
+
declare function reactQuery(options?: OptionsReactQuery): Promise<TypedFlatConfigItem[]>;
|
|
17956
|
+
//#endregion
|
|
17881
17957
|
//#region src/configs/regexp.d.ts
|
|
17882
17958
|
declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
17883
17959
|
//#endregion
|
|
@@ -17940,4 +18016,4 @@ declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
|
|
|
17940
18016
|
*/
|
|
17941
18017
|
declare function zod(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
17942
18018
|
//#endregion
|
|
17943
|
-
export { type Awaitable, type ConfigNames, type ESLintGlobalsPropValue, type OptionsBanner, type OptionsBun, type OptionsCSpell, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsGraphQL, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsJSDoc, type OptionsJavascript, type OptionsNext, type OptionsNx, type OptionsNxDependencyChecks, type OptionsNxEnforceModuleBoundaries, type OptionsOverrides, type OptionsPnpm, type OptionsProjectType, type OptionsReact, type OptionsRegExp, type OptionsStorybook, type OptionsStylistic, type OptionsTSDoc, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type PresetConfig, type PresetResult, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, StylisticOptions, type TypedFlatConfigItem, type UserConfig, astro, banner, bun, cspell, defineConfig as default, defineConfig, defaultPluginRenaming, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
|
18019
|
+
export { type Awaitable, type ConfigNames, type ESLintGlobalsPropValue, type OptionsBanner, type OptionsBun, type OptionsCSpell, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsGraphQL, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsJSDoc, type OptionsJavascript, type OptionsNext, type OptionsNx, type OptionsNxDependencyChecks, type OptionsNxEnforceModuleBoundaries, type OptionsOverrides, type OptionsPnpm, type OptionsProjectType, type OptionsReact, type OptionsReactQuery, type OptionsRegExp, type OptionsStorybook, type OptionsStylistic, type OptionsTSDoc, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type PresetConfig, type PresetResult, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, StylisticOptions, type TypedFlatConfigItem, type UserConfig, astro, banner, bun, cspell, defineConfig as default, defineConfig, defaultPluginRenaming, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, reactQuery, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
package/dist/index.d.mts
CHANGED
|
@@ -511,6 +511,46 @@ Backward pagination arguments
|
|
|
511
511
|
* Checks common nx-plugin configuration files for validity
|
|
512
512
|
*/
|
|
513
513
|
'@nx/nx-plugin-checks'?: Linter.RuleEntry<NxNxPluginChecks>;
|
|
514
|
+
/**
|
|
515
|
+
* Exhaustive deps rule for useQuery
|
|
516
|
+
* @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
|
|
517
|
+
*/
|
|
518
|
+
'@tanstack/query/exhaustive-deps'?: Linter.RuleEntry<TanstackQueryExhaustiveDeps>;
|
|
519
|
+
/**
|
|
520
|
+
* Ensure correct order of inference sensitive properties for infinite queries
|
|
521
|
+
* @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
|
|
522
|
+
*/
|
|
523
|
+
'@tanstack/query/infinite-query-property-order'?: Linter.RuleEntry<[]>;
|
|
524
|
+
/**
|
|
525
|
+
* Ensure correct order of inference-sensitive properties in useMutation()
|
|
526
|
+
* @see https://tanstack.com/query/latest/docs/eslint/mutation-property-order
|
|
527
|
+
*/
|
|
528
|
+
'@tanstack/query/mutation-property-order'?: Linter.RuleEntry<[]>;
|
|
529
|
+
/**
|
|
530
|
+
* Disallows rest destructuring in queries
|
|
531
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
|
|
532
|
+
*/
|
|
533
|
+
'@tanstack/query/no-rest-destructuring'?: Linter.RuleEntry<[]>;
|
|
534
|
+
/**
|
|
535
|
+
* Disallow putting the result of query hooks directly in a React hook dependency array
|
|
536
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
|
|
537
|
+
*/
|
|
538
|
+
'@tanstack/query/no-unstable-deps'?: Linter.RuleEntry<[]>;
|
|
539
|
+
/**
|
|
540
|
+
* Ensures queryFn returns a non-undefined value
|
|
541
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
|
|
542
|
+
*/
|
|
543
|
+
'@tanstack/query/no-void-query-fn'?: Linter.RuleEntry<[]>;
|
|
544
|
+
/**
|
|
545
|
+
* Prefer using queryOptions() to co-locate queryKey and queryFn
|
|
546
|
+
* @see https://tanstack.com/query/latest/docs/eslint/prefer-query-options
|
|
547
|
+
*/
|
|
548
|
+
'@tanstack/query/prefer-query-options'?: Linter.RuleEntry<[]>;
|
|
549
|
+
/**
|
|
550
|
+
* Makes sure that QueryClient is stable
|
|
551
|
+
* @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
|
|
552
|
+
*/
|
|
553
|
+
'@tanstack/query/stable-query-client'?: Linter.RuleEntry<[]>;
|
|
514
554
|
/**
|
|
515
555
|
* Enforce getter and setter pairs in objects and classes
|
|
516
556
|
* @see https://eslint.org/docs/latest/rules/accessor-pairs
|
|
@@ -8305,6 +8345,13 @@ type NxNxPluginChecks = [] | [{
|
|
|
8305
8345
|
allowedVersionStrings?: string[];
|
|
8306
8346
|
tsConfig?: string;
|
|
8307
8347
|
}];
|
|
8348
|
+
// ----- @tanstack/query/exhaustive-deps -----
|
|
8349
|
+
type TanstackQueryExhaustiveDeps = [] | [{
|
|
8350
|
+
allowlist?: {
|
|
8351
|
+
variables?: string[];
|
|
8352
|
+
types?: string[];
|
|
8353
|
+
};
|
|
8354
|
+
}];
|
|
8308
8355
|
// ----- accessor-pairs -----
|
|
8309
8356
|
type AccessorPairs = [] | [{
|
|
8310
8357
|
getWithoutSet?: boolean;
|
|
@@ -16917,7 +16964,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16917
16964
|
onlyEquality?: boolean;
|
|
16918
16965
|
}];
|
|
16919
16966
|
// Names of all the configs
|
|
16920
|
-
type ConfigNames = "storm/banner" | "storm/bun/setup" | "bun/recommended/package-json" | "bun/recommended/package-json" | "storm/cspell/rules" | "storm/astro/setup" | "storm/astro/rules" | "storm/formatter/setup" | "storm/imports/rules" | "storm/graphql/setup" | "storm/graphql/rules" | "storm/graphql/relay" | "storm/javascript/setup" | "storm/javascript/rules" | "storm/jsx/rules" | "storm/jsdoc/rules" | "storm/jsonc/setup" | "storm/jsonc/rules" | "storm/markdown/setup" | "storm/markdown/rules" | "mdx/flat" | "storm/node/rules" | "storm/nx/setup" | "storm/nx/schema" | "storm/nx/dependency-check" | "storm/nx/module-boundaries" | "storm/next/rules" | "storm/prettier" | "storm/perfectionist/rules" | "storm/pnpm/setup" | "storm/pnpm/package-json" | "storm/pnpm/pnpm-workspace-yaml" | "storm/react/setup" | "storm/react/rules" | "storm/react-native/rules" | "storm/sort/package-json" | "storm/stylistic/rules" | "storm/secrets/rules" | "storm/storybook/setup" | "storm/storybook/rules" | "storm/storybook/main" | "storm/test/setup" | "storm/test/rules" | "storm/tsdoc/rules" | "storm/toml/setup" | "storm/toml/rules" | "storm/typescript/setup" | "storm/typescript/parser" | "storm/typescript/type-aware-parser" | "storm/typescript/rules" | "storm/typescript/rules-type-aware" | "storm/regexp/rules" | "storm/unicorn/rules" | "storm/unocss" | "storm/yaml/setup" | "storm/yaml/rules" | "storm/zod/rules";
|
|
16967
|
+
type ConfigNames = "storm/banner" | "storm/bun/setup" | "bun/recommended/package-json" | "bun/recommended/package-json" | "storm/cspell/rules" | "storm/astro/setup" | "storm/astro/rules" | "storm/formatter/setup" | "storm/imports/rules" | "storm/graphql/setup" | "storm/graphql/rules" | "storm/graphql/relay" | "storm/javascript/setup" | "storm/javascript/rules" | "storm/jsx/rules" | "storm/jsdoc/rules" | "storm/jsonc/setup" | "storm/jsonc/rules" | "storm/markdown/setup" | "storm/markdown/rules" | "mdx/flat" | "storm/node/rules" | "storm/nx/setup" | "storm/nx/schema" | "storm/nx/dependency-check" | "storm/nx/module-boundaries" | "storm/next/rules" | "storm/prettier" | "storm/perfectionist/rules" | "storm/pnpm/setup" | "storm/pnpm/package-json" | "storm/pnpm/pnpm-workspace-yaml" | "storm/react/setup" | "storm/react/rules" | "storm/react-native/rules" | "storm/react-query/rules" | "storm/sort/package-json" | "storm/stylistic/rules" | "storm/secrets/rules" | "storm/storybook/setup" | "storm/storybook/rules" | "storm/storybook/main" | "storm/test/setup" | "storm/test/rules" | "storm/tsdoc/rules" | "storm/toml/setup" | "storm/toml/rules" | "storm/typescript/setup" | "storm/typescript/parser" | "storm/typescript/type-aware-parser" | "storm/typescript/rules" | "storm/typescript/rules-type-aware" | "storm/regexp/rules" | "storm/unicorn/rules" | "storm/unocss" | "storm/yaml/setup" | "storm/yaml/rules" | "storm/zod/rules";
|
|
16921
16968
|
//#endregion
|
|
16922
16969
|
//#region src/vendor/prettier-types.d.ts
|
|
16923
16970
|
/**
|
|
@@ -17319,6 +17366,16 @@ interface OptionsStorybook extends OptionsOverrides {
|
|
|
17319
17366
|
*/
|
|
17320
17367
|
csf?: "none" | "loose" | "strict";
|
|
17321
17368
|
}
|
|
17369
|
+
interface OptionsReactQuery extends OptionsOverrides {
|
|
17370
|
+
/**
|
|
17371
|
+
* Use the strict recommended config, which enables additional opinionated rules.
|
|
17372
|
+
*
|
|
17373
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
17374
|
+
*
|
|
17375
|
+
* @defaultValue false
|
|
17376
|
+
*/
|
|
17377
|
+
strict?: boolean;
|
|
17378
|
+
}
|
|
17322
17379
|
interface OptionsReact extends OptionsOverrides {
|
|
17323
17380
|
/**
|
|
17324
17381
|
* Use a strict mode for React rules, which will enable more strict rules that may cause more false positives but can catch more potential issues.
|
|
@@ -17698,6 +17755,17 @@ interface OptionsConfig extends OptionsComponentExts, OptionsJavascript, Options
|
|
|
17698
17755
|
* @defaultValue false
|
|
17699
17756
|
*/
|
|
17700
17757
|
storybook?: boolean | OptionsStorybook;
|
|
17758
|
+
/**
|
|
17759
|
+
* Enable TanStack Query rules.
|
|
17760
|
+
*
|
|
17761
|
+
* Requires installing:
|
|
17762
|
+
* - `@tanstack/eslint-plugin-query`
|
|
17763
|
+
*
|
|
17764
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
17765
|
+
*
|
|
17766
|
+
* @defaultValue false
|
|
17767
|
+
*/
|
|
17768
|
+
"react-query"?: boolean | OptionsReactQuery;
|
|
17701
17769
|
/**
|
|
17702
17770
|
* Enable react rules.
|
|
17703
17771
|
*
|
|
@@ -17878,6 +17946,14 @@ declare function react(options?: OptionsComponentExts & Omit<OptionsTypeScriptPa
|
|
|
17878
17946
|
*/
|
|
17879
17947
|
declare function reactNative(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
17880
17948
|
//#endregion
|
|
17949
|
+
//#region src/configs/react-query.d.ts
|
|
17950
|
+
/**
|
|
17951
|
+
* Config for TanStack Query ESLint plugin.
|
|
17952
|
+
*
|
|
17953
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
17954
|
+
*/
|
|
17955
|
+
declare function reactQuery(options?: OptionsReactQuery): Promise<TypedFlatConfigItem[]>;
|
|
17956
|
+
//#endregion
|
|
17881
17957
|
//#region src/configs/regexp.d.ts
|
|
17882
17958
|
declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
17883
17959
|
//#endregion
|
|
@@ -17940,4 +18016,4 @@ declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
|
|
|
17940
18016
|
*/
|
|
17941
18017
|
declare function zod(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
17942
18018
|
//#endregion
|
|
17943
|
-
export { type Awaitable, type ConfigNames, type ESLintGlobalsPropValue, type OptionsBanner, type OptionsBun, type OptionsCSpell, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsGraphQL, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsJSDoc, type OptionsJavascript, type OptionsNext, type OptionsNx, type OptionsNxDependencyChecks, type OptionsNxEnforceModuleBoundaries, type OptionsOverrides, type OptionsPnpm, type OptionsProjectType, type OptionsReact, type OptionsRegExp, type OptionsStorybook, type OptionsStylistic, type OptionsTSDoc, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type PresetConfig, type PresetResult, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, StylisticOptions, type TypedFlatConfigItem, type UserConfig, astro, banner, bun, cspell, defineConfig as default, defineConfig, defaultPluginRenaming, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
|
18019
|
+
export { type Awaitable, type ConfigNames, type ESLintGlobalsPropValue, type OptionsBanner, type OptionsBun, type OptionsCSpell, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsGraphQL, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsJSDoc, type OptionsJavascript, type OptionsNext, type OptionsNx, type OptionsNxDependencyChecks, type OptionsNxEnforceModuleBoundaries, type OptionsOverrides, type OptionsPnpm, type OptionsProjectType, type OptionsReact, type OptionsReactQuery, type OptionsRegExp, type OptionsStorybook, type OptionsStylistic, type OptionsTSDoc, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type PresetConfig, type PresetResult, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, StylisticOptions, type TypedFlatConfigItem, type UserConfig, astro, banner, bun, cspell, defineConfig as default, defineConfig, defaultPluginRenaming, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, reactQuery, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
package/dist/index.mjs
CHANGED
|
@@ -11640,6 +11640,28 @@ async function reactNative(options = {}) {
|
|
|
11640
11640
|
}];
|
|
11641
11641
|
}
|
|
11642
11642
|
//#endregion
|
|
11643
|
+
//#region src/configs/react-query.ts
|
|
11644
|
+
/**
|
|
11645
|
+
* Config for TanStack Query ESLint plugin.
|
|
11646
|
+
*
|
|
11647
|
+
* @see https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
|
|
11648
|
+
*/
|
|
11649
|
+
async function reactQuery(options = {}) {
|
|
11650
|
+
const { strict = false, overrides = {} } = options;
|
|
11651
|
+
await ensurePackages(["@tanstack/eslint-plugin-query"]);
|
|
11652
|
+
const pluginQuery = await interopDefault(import("@tanstack/eslint-plugin-query"));
|
|
11653
|
+
const configKey = strict ? "flat/recommended-strict" : "flat/recommended";
|
|
11654
|
+
const [config] = pluginQuery.configs[configKey];
|
|
11655
|
+
return [{
|
|
11656
|
+
...config,
|
|
11657
|
+
name: "storm/react-query/rules",
|
|
11658
|
+
rules: {
|
|
11659
|
+
...config?.rules ?? {},
|
|
11660
|
+
...overrides
|
|
11661
|
+
}
|
|
11662
|
+
}];
|
|
11663
|
+
}
|
|
11664
|
+
//#endregion
|
|
11643
11665
|
//#region src/configs/regexp.ts
|
|
11644
11666
|
async function regexp(options = {}) {
|
|
11645
11667
|
const config = configs["flat/recommended"];
|
|
@@ -12494,7 +12516,7 @@ function getOverrides(options, key) {
|
|
|
12494
12516
|
* @param userConfigs - Additional ESLint configurations.
|
|
12495
12517
|
*/
|
|
12496
12518
|
function preset(options, ...userConfigs) {
|
|
12497
|
-
const { name, globals = {}, banner: enableBanner = true, astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, mdx: enableMdx = false, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, jsdoc: enableJSDoc = false, tsdoc: enableTSDoc = true, test: enableTest = true, unocss: enableUnoCSS = false, zod: enableZod = false, bun: enableBun, pnpm: enablePnpm } = options;
|
|
12519
|
+
const { name, globals = {}, banner: enableBanner = true, astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, mdx: enableMdx = false, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, "react-query": enableReactQuery = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, jsdoc: enableJSDoc = false, tsdoc: enableTSDoc = true, test: enableTest = true, unocss: enableUnoCSS = false, zod: enableZod = false, bun: enableBun, pnpm: enablePnpm } = options;
|
|
12498
12520
|
const packageManager = detectPackageManager();
|
|
12499
12521
|
let isInEditor = options.isInEditor;
|
|
12500
12522
|
if (!isInEditor) {
|
|
@@ -12573,6 +12595,7 @@ function preset(options, ...userConfigs) {
|
|
|
12573
12595
|
}));
|
|
12574
12596
|
if (enableNext) configs.push(next(resolveSubOptions(options, "next")));
|
|
12575
12597
|
if (enableStorybook) configs.push(storybook(resolveSubOptions(options, "storybook")));
|
|
12598
|
+
if (enableReactQuery) configs.push(reactQuery(resolveSubOptions(options, "react-query")));
|
|
12576
12599
|
if (enableUnoCSS) configs.push(unocss({
|
|
12577
12600
|
...resolveSubOptions(options, "unocss"),
|
|
12578
12601
|
overrides: getOverrides(options, "unocss")
|
|
@@ -12629,4 +12652,4 @@ const defineConfig = preset;
|
|
|
12629
12652
|
//#region src/index.ts
|
|
12630
12653
|
var src_default = defineConfig;
|
|
12631
12654
|
//#endregion
|
|
12632
|
-
export { StylisticConfigDefaults, astro, banner, bun, cspell, src_default as default, defaultPluginRenaming, defineConfig, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
|
12655
|
+
export { StylisticConfigDefaults, astro, banner, bun, cspell, src_default as default, defaultPluginRenaming, defineConfig, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, reactQuery, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/eslint",
|
|
3
|
-
"version": "0.170.
|
|
3
|
+
"version": "0.170.168",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing the base ESLint configuration used by Storm Software across many projects.",
|
|
6
6
|
"keywords": [
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"@eslint/eslintrc": "^3.3.6",
|
|
66
66
|
"@eslint/markdown": "^6.6.0",
|
|
67
67
|
"@nx/eslint-plugin": "23.1.1",
|
|
68
|
-
"@storm-software/config": "1.138.
|
|
69
|
-
"@storm-software/config-tools": "1.190.
|
|
70
|
-
"@storm-software/eslint-plugin-banner": "0.0.
|
|
71
|
-
"@storm-software/eslint-plugin-tsdoc": "0.0.
|
|
72
|
-
"@storm-software/package-constants": "0.1.
|
|
68
|
+
"@storm-software/config": "1.138.69",
|
|
69
|
+
"@storm-software/config-tools": "1.190.133",
|
|
70
|
+
"@storm-software/eslint-plugin-banner": "0.0.98",
|
|
71
|
+
"@storm-software/eslint-plugin-tsdoc": "0.0.96",
|
|
72
|
+
"@storm-software/package-constants": "0.1.145",
|
|
73
73
|
"@stylistic/eslint-plugin": "^4.4.1",
|
|
74
74
|
"@typescript-eslint/eslint-plugin": "^8.66.0",
|
|
75
75
|
"@typescript-eslint/parser": "^8.66.0",
|
|
@@ -125,10 +125,11 @@
|
|
|
125
125
|
"@next/eslint-plugin-next": "^15.5.23",
|
|
126
126
|
"@nx/eslint": "23.1.1",
|
|
127
127
|
"@prettier/plugin-xml": "^3.4.2",
|
|
128
|
-
"@storm-software/eslint-plugin-bun": "0.0.
|
|
129
|
-
"@storm-software/eslint-plugin-pnpm": "0.0.
|
|
130
|
-
"@storm-software/tsdoc": "0.13.
|
|
128
|
+
"@storm-software/eslint-plugin-bun": "0.0.21",
|
|
129
|
+
"@storm-software/eslint-plugin-pnpm": "0.0.96",
|
|
130
|
+
"@storm-software/tsdoc": "0.13.285",
|
|
131
131
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
132
|
+
"@tanstack/eslint-plugin-query": "^5.101.4",
|
|
132
133
|
"@types/eslint": "^9.6.1",
|
|
133
134
|
"@types/eslint__js": "^8.42.3",
|
|
134
135
|
"@types/estree": "^1.0.9",
|
|
@@ -172,6 +173,7 @@
|
|
|
172
173
|
"@storm-software/eslint-plugin-bun": "*",
|
|
173
174
|
"@storm-software/eslint-plugin-pnpm": "*",
|
|
174
175
|
"@storm-software/tsdoc": "*",
|
|
176
|
+
"@tanstack/eslint-plugin-query": "^5.0.0",
|
|
175
177
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
176
178
|
"astro-eslint-parser": "^1.0.2",
|
|
177
179
|
"debug": "^4.3.2",
|
|
@@ -202,6 +204,7 @@
|
|
|
202
204
|
"@storm-software/eslint-plugin-bun": { "optional": true },
|
|
203
205
|
"@storm-software/eslint-plugin-pnpm": { "optional": true },
|
|
204
206
|
"@storm-software/tsdoc": { "optional": true },
|
|
207
|
+
"@tanstack/eslint-plugin-query": { "optional": true },
|
|
205
208
|
"@unocss/eslint-plugin": { "optional": true },
|
|
206
209
|
"astro-eslint-parser": { "optional": true },
|
|
207
210
|
"debug": { "optional": false },
|
|
@@ -225,5 +228,5 @@
|
|
|
225
228
|
"zod": { "optional": true }
|
|
226
229
|
},
|
|
227
230
|
"publishConfig": { "access": "public" },
|
|
228
|
-
"gitHead": "
|
|
231
|
+
"gitHead": "7302cd6416daad63ba041a3be4076bcde2637373"
|
|
229
232
|
}
|