@tanstack/eslint-plugin-query 5.17.20 → 5.18.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/cjs/index.d.cts +2 -2
- package/dist/cjs/utils/create-rule.cjs +1 -1
- package/dist/cjs/utils/create-rule.cjs.map +1 -1
- package/dist/cjs/utils/create-rule.d.cts +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/utils/create-rule.d.ts +1 -1
- package/dist/esm/utils/create-rule.js +1 -1
- package/dist/esm/utils/create-rule.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/exhaustive-deps.test.ts +2 -2
- package/src/rules/no-rest-desctructuring/no-rest-destructuring.test.ts +1 -1
- package/src/utils/create-rule.ts +1 -1
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { configs } from './configs';
|
|
2
|
-
export { rules } from './rules';
|
|
1
|
+
export { configs } from './configs.cjs';
|
|
2
|
+
export { rules } from './rules.cjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils = require("@typescript-eslint/utils");
|
|
4
4
|
const detectReactQueryImports = require("./detect-react-query-imports.cjs");
|
|
5
|
-
const getDocsUrl = (ruleName) => `https://tanstack.com/query/
|
|
5
|
+
const getDocsUrl = (ruleName) => `https://tanstack.com/query/latest/docs/eslint/${ruleName}`;
|
|
6
6
|
function createRule({ create, ...rest }) {
|
|
7
7
|
return utils.ESLintUtils.RuleCreator(getDocsUrl)({
|
|
8
8
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-rule.cjs","sources":["../../../src/utils/create-rule.ts"],"sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils'\nimport { detectTanstackQueryImports } from './detect-react-query-imports'\nimport type { EnhancedCreate } from './detect-react-query-imports'\n\nconst getDocsUrl = (ruleName: string): string =>\n `https://tanstack.com/query/
|
|
1
|
+
{"version":3,"file":"create-rule.cjs","sources":["../../../src/utils/create-rule.ts"],"sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils'\nimport { detectTanstackQueryImports } from './detect-react-query-imports'\nimport type { EnhancedCreate } from './detect-react-query-imports'\n\nconst getDocsUrl = (ruleName: string): string =>\n `https://tanstack.com/query/latest/docs/eslint/${ruleName}`\n\ntype EslintRule = Omit<\n Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0],\n 'create'\n> & {\n create: EnhancedCreate\n}\n\nexport function createRule({ create, ...rest }: EslintRule) {\n return ESLintUtils.RuleCreator(getDocsUrl)({\n ...rest,\n create: detectTanstackQueryImports(create),\n })\n}\n"],"names":["ESLintUtils","detectTanstackQueryImports"],"mappings":";;;;AAIA,MAAM,aAAa,CAAC,aAClB,iDAAiD,QAAQ;AASpD,SAAS,WAAW,EAAE,QAAQ,GAAG,QAAoB;AACnD,SAAAA,MAAA,YAAY,YAAY,UAAU,EAAE;AAAA,IACzC,GAAG;AAAA,IACH,QAAQC,mDAA2B,MAAM;AAAA,EAAA,CAC1C;AACH;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import type { EnhancedCreate } from './detect-react-query-imports';
|
|
2
|
+
import type { EnhancedCreate } from './detect-react-query-imports.cjs';
|
|
3
3
|
type EslintRule = Omit<Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0], 'create'> & {
|
|
4
4
|
create: EnhancedCreate;
|
|
5
5
|
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { configs } from './configs';
|
|
2
|
-
export { rules } from './rules';
|
|
1
|
+
export { configs } from './configs.js';
|
|
2
|
+
export { rules } from './rules.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import type { EnhancedCreate } from './detect-react-query-imports';
|
|
2
|
+
import type { EnhancedCreate } from './detect-react-query-imports.js';
|
|
3
3
|
type EslintRule = Omit<Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0], 'create'> & {
|
|
4
4
|
create: EnhancedCreate;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
2
2
|
import { detectTanstackQueryImports } from "./detect-react-query-imports.js";
|
|
3
|
-
const getDocsUrl = (ruleName) => `https://tanstack.com/query/
|
|
3
|
+
const getDocsUrl = (ruleName) => `https://tanstack.com/query/latest/docs/eslint/${ruleName}`;
|
|
4
4
|
function createRule({ create, ...rest }) {
|
|
5
5
|
return ESLintUtils.RuleCreator(getDocsUrl)({
|
|
6
6
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-rule.js","sources":["../../../src/utils/create-rule.ts"],"sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils'\nimport { detectTanstackQueryImports } from './detect-react-query-imports'\nimport type { EnhancedCreate } from './detect-react-query-imports'\n\nconst getDocsUrl = (ruleName: string): string =>\n `https://tanstack.com/query/
|
|
1
|
+
{"version":3,"file":"create-rule.js","sources":["../../../src/utils/create-rule.ts"],"sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils'\nimport { detectTanstackQueryImports } from './detect-react-query-imports'\nimport type { EnhancedCreate } from './detect-react-query-imports'\n\nconst getDocsUrl = (ruleName: string): string =>\n `https://tanstack.com/query/latest/docs/eslint/${ruleName}`\n\ntype EslintRule = Omit<\n Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0],\n 'create'\n> & {\n create: EnhancedCreate\n}\n\nexport function createRule({ create, ...rest }: EslintRule) {\n return ESLintUtils.RuleCreator(getDocsUrl)({\n ...rest,\n create: detectTanstackQueryImports(create),\n })\n}\n"],"names":[],"mappings":";;AAIA,MAAM,aAAa,CAAC,aAClB,iDAAiD,QAAQ;AASpD,SAAS,WAAW,EAAE,QAAQ,GAAG,QAAoB;AACnD,SAAA,YAAY,YAAY,UAAU,EAAE;AAAA,IACzC,GAAG;AAAA,IACH,QAAQ,2BAA2B,MAAM;AAAA,EAAA,CAC1C;AACH;"}
|
package/package.json
CHANGED
|
@@ -364,13 +364,13 @@ ruleTester.run('exhaustive-deps', rule, {
|
|
|
364
364
|
const CONST_VAL = 1
|
|
365
365
|
function useHook() {
|
|
366
366
|
const queryClient = useQueryClient()
|
|
367
|
-
const
|
|
367
|
+
const queryClient2 = useQueryClient()
|
|
368
368
|
useQuery({
|
|
369
369
|
queryKey: ["foo"],
|
|
370
370
|
queryFn: () => {
|
|
371
371
|
doSomething(queryClient)
|
|
372
372
|
queryClient.invalidateQueries()
|
|
373
|
-
doSomethingSus(
|
|
373
|
+
doSomethingSus(queryClient2)
|
|
374
374
|
}
|
|
375
375
|
});
|
|
376
376
|
}
|
package/src/utils/create-rule.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { detectTanstackQueryImports } from './detect-react-query-imports'
|
|
|
3
3
|
import type { EnhancedCreate } from './detect-react-query-imports'
|
|
4
4
|
|
|
5
5
|
const getDocsUrl = (ruleName: string): string =>
|
|
6
|
-
`https://tanstack.com/query/
|
|
6
|
+
`https://tanstack.com/query/latest/docs/eslint/${ruleName}`
|
|
7
7
|
|
|
8
8
|
type EslintRule = Omit<
|
|
9
9
|
Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0],
|