@ncontiero/eslint-config 8.0.0-beta.9 → 8.0.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/README.md +2 -2
- package/dist/index.d.mts +48 -54
- package/dist/index.mjs +1 -2
- package/package.json +16 -17
package/README.md
CHANGED
|
@@ -199,14 +199,14 @@ We provide some optional configs for specific use cases, that we don't include t
|
|
|
199
199
|
|
|
200
200
|
#### TanStack Query
|
|
201
201
|
|
|
202
|
-
To enable TanStack Query support, you need to
|
|
202
|
+
To enable TanStack Query support, you need to explicitly turn it on:
|
|
203
203
|
|
|
204
204
|
```js
|
|
205
205
|
// eslint.config.js
|
|
206
206
|
import { ncontiero } from "@ncontiero/eslint-config";
|
|
207
207
|
|
|
208
208
|
export default ncontiero({
|
|
209
|
-
|
|
209
|
+
tanstackQuery: true,
|
|
210
210
|
});
|
|
211
211
|
```
|
|
212
212
|
|
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,46 @@ import { Options as PrettierOptions } from "prettier";
|
|
|
5
5
|
|
|
6
6
|
//#region src/typegen.d.ts
|
|
7
7
|
interface RuleOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Exhaustive deps rule for useQuery
|
|
10
|
+
* @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
|
|
11
|
+
*/
|
|
12
|
+
'@tanstack/query/exhaustive-deps'?: Linter.RuleEntry<TanstackQueryExhaustiveDeps>;
|
|
13
|
+
/**
|
|
14
|
+
* Ensure correct order of inference sensitive properties for infinite queries
|
|
15
|
+
* @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
|
|
16
|
+
*/
|
|
17
|
+
'@tanstack/query/infinite-query-property-order'?: Linter.RuleEntry<[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure correct order of inference-sensitive properties in useMutation()
|
|
20
|
+
* @see https://tanstack.com/query/latest/docs/eslint/mutation-property-order
|
|
21
|
+
*/
|
|
22
|
+
'@tanstack/query/mutation-property-order'?: Linter.RuleEntry<[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Disallows rest destructuring in queries
|
|
25
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
|
|
26
|
+
*/
|
|
27
|
+
'@tanstack/query/no-rest-destructuring'?: Linter.RuleEntry<[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Disallow putting the result of query hooks directly in a React hook dependency array
|
|
30
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
|
|
31
|
+
*/
|
|
32
|
+
'@tanstack/query/no-unstable-deps'?: Linter.RuleEntry<[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Ensures queryFn returns a non-undefined value
|
|
35
|
+
* @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
|
|
36
|
+
*/
|
|
37
|
+
'@tanstack/query/no-void-query-fn'?: Linter.RuleEntry<[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Prefer using queryOptions() to co-locate queryKey and queryFn
|
|
40
|
+
* @see https://tanstack.com/query/latest/docs/eslint/prefer-query-options
|
|
41
|
+
*/
|
|
42
|
+
'@tanstack/query/prefer-query-options'?: Linter.RuleEntry<[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Makes sure that QueryClient is stable
|
|
45
|
+
* @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
|
|
46
|
+
*/
|
|
47
|
+
'@tanstack/query/stable-query-client'?: Linter.RuleEntry<[]>;
|
|
8
48
|
/**
|
|
9
49
|
* Enforce getter and setter pairs in objects and classes
|
|
10
50
|
* @see https://eslint.org/docs/latest/rules/accessor-pairs
|
|
@@ -4863,46 +4903,6 @@ interface RuleOptions {
|
|
|
4863
4903
|
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md
|
|
4864
4904
|
*/
|
|
4865
4905
|
'tailwindcss/no-unnecessary-whitespace'?: Linter.RuleEntry<TailwindcssNoUnnecessaryWhitespace>;
|
|
4866
|
-
/**
|
|
4867
|
-
* Exhaustive deps rule for useQuery
|
|
4868
|
-
* @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
|
|
4869
|
-
*/
|
|
4870
|
-
'tanstack-query/exhaustive-deps'?: Linter.RuleEntry<TanstackQueryExhaustiveDeps>;
|
|
4871
|
-
/**
|
|
4872
|
-
* Ensure correct order of inference sensitive properties for infinite queries
|
|
4873
|
-
* @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
|
|
4874
|
-
*/
|
|
4875
|
-
'tanstack-query/infinite-query-property-order'?: Linter.RuleEntry<[]>;
|
|
4876
|
-
/**
|
|
4877
|
-
* Ensure correct order of inference-sensitive properties in useMutation()
|
|
4878
|
-
* @see https://tanstack.com/query/latest/docs/eslint/mutation-property-order
|
|
4879
|
-
*/
|
|
4880
|
-
'tanstack-query/mutation-property-order'?: Linter.RuleEntry<[]>;
|
|
4881
|
-
/**
|
|
4882
|
-
* Disallows rest destructuring in queries
|
|
4883
|
-
* @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
|
|
4884
|
-
*/
|
|
4885
|
-
'tanstack-query/no-rest-destructuring'?: Linter.RuleEntry<[]>;
|
|
4886
|
-
/**
|
|
4887
|
-
* Disallow putting the result of query hooks directly in a React hook dependency array
|
|
4888
|
-
* @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
|
|
4889
|
-
*/
|
|
4890
|
-
'tanstack-query/no-unstable-deps'?: Linter.RuleEntry<[]>;
|
|
4891
|
-
/**
|
|
4892
|
-
* Ensures queryFn returns a non-undefined value
|
|
4893
|
-
* @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
|
|
4894
|
-
*/
|
|
4895
|
-
'tanstack-query/no-void-query-fn'?: Linter.RuleEntry<[]>;
|
|
4896
|
-
/**
|
|
4897
|
-
* Prefer using queryOptions() to co-locate queryKey and queryFn
|
|
4898
|
-
* @see https://tanstack.com/query/latest/docs/eslint/prefer-query-options
|
|
4899
|
-
*/
|
|
4900
|
-
'tanstack-query/prefer-query-options'?: Linter.RuleEntry<[]>;
|
|
4901
|
-
/**
|
|
4902
|
-
* Makes sure that QueryClient is stable
|
|
4903
|
-
* @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
|
|
4904
|
-
*/
|
|
4905
|
-
'tanstack-query/stable-query-client'?: Linter.RuleEntry<[]>;
|
|
4906
4906
|
/**
|
|
4907
4907
|
* Require or disallow spacing around embedded expressions of template strings
|
|
4908
4908
|
* @see https://eslint.org/docs/latest/rules/template-curly-spacing
|
|
@@ -6656,7 +6656,13 @@ interface RuleOptions {
|
|
|
6656
6656
|
'yoda'?: Linter.RuleEntry<Yoda>;
|
|
6657
6657
|
}
|
|
6658
6658
|
/* ======= Declarations ======= */
|
|
6659
|
-
// -----
|
|
6659
|
+
// ----- @tanstack/query/exhaustive-deps -----
|
|
6660
|
+
type TanstackQueryExhaustiveDeps = [] | [{
|
|
6661
|
+
allowlist?: {
|
|
6662
|
+
variables?: string[];
|
|
6663
|
+
types?: string[];
|
|
6664
|
+
};
|
|
6665
|
+
}]; // ----- accessor-pairs -----
|
|
6660
6666
|
type AccessorPairs = [] | [{
|
|
6661
6667
|
getWithoutSet?: boolean;
|
|
6662
6668
|
setWithoutGet?: boolean;
|
|
@@ -15026,12 +15032,6 @@ type TailwindcssNoUnnecessaryWhitespace = [] | [{
|
|
|
15026
15032
|
rootFontSize?: number;
|
|
15027
15033
|
cwd?: string;
|
|
15028
15034
|
allowMultiline?: boolean;
|
|
15029
|
-
}]; // ----- tanstack-query/exhaustive-deps -----
|
|
15030
|
-
type TanstackQueryExhaustiveDeps = [] | [{
|
|
15031
|
-
allowlist?: {
|
|
15032
|
-
variables?: string[];
|
|
15033
|
-
types?: string[];
|
|
15034
|
-
};
|
|
15035
15035
|
}]; // ----- template-curly-spacing -----
|
|
15036
15036
|
type TemplateCurlySpacing = [] | [("always" | "never")]; // ----- template-tag-spacing -----
|
|
15037
15037
|
type TemplateTagSpacing = [] | [("always" | "never")]; // ----- toml/array-bracket-newline -----
|
|
@@ -16492,7 +16492,7 @@ type ConfigNames = 'ncontiero/gitignore' | 'ncontiero/ignores' | 'ncontiero/java
|
|
|
16492
16492
|
//#region src/types.d.ts
|
|
16493
16493
|
type Awaitable<T> = T | Promise<T>;
|
|
16494
16494
|
interface Rules extends RuleOptions {}
|
|
16495
|
-
interface FlatConfigItem extends Omit<Linter.Config
|
|
16495
|
+
interface FlatConfigItem extends Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> {
|
|
16496
16496
|
/**
|
|
16497
16497
|
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
16498
16498
|
* When `files` is specified, these plugins are only available to the matching files.
|
|
@@ -16500,11 +16500,6 @@ interface FlatConfigItem extends Omit<Linter.Config, "plugins" | "rules"> {
|
|
|
16500
16500
|
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
16501
16501
|
*/
|
|
16502
16502
|
plugins?: Record<string, any>;
|
|
16503
|
-
/**
|
|
16504
|
-
* An object containing the configured rules. When `files` or `ignores` are
|
|
16505
|
-
* specified, these rule configurations are only available to the matching files.
|
|
16506
|
-
*/
|
|
16507
|
-
rules?: Rules;
|
|
16508
16503
|
}
|
|
16509
16504
|
interface OptionsFiles {
|
|
16510
16505
|
/**
|
|
@@ -16841,7 +16836,6 @@ declare const hasTailwind: boolean;
|
|
|
16841
16836
|
//#region src/factory.d.ts
|
|
16842
16837
|
declare const defaultPluginRenaming: {
|
|
16843
16838
|
"@eslint-react": string;
|
|
16844
|
-
"@tanstack/query": string;
|
|
16845
16839
|
"@typescript-eslint": string;
|
|
16846
16840
|
};
|
|
16847
16841
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
package/dist/index.mjs
CHANGED
|
@@ -1308,7 +1308,7 @@ async function tanstackQuery(options = {}) {
|
|
|
1308
1308
|
const config = tanstackQueryPlugin.configs.recommended;
|
|
1309
1309
|
return [{
|
|
1310
1310
|
name: "ncontiero/tanstack-query/setup",
|
|
1311
|
-
plugins: { "tanstack
|
|
1311
|
+
plugins: { "@tanstack/query": tanstackQueryPlugin }
|
|
1312
1312
|
}, {
|
|
1313
1313
|
files,
|
|
1314
1314
|
name: "ncontiero/tanstack-query/rules",
|
|
@@ -1679,7 +1679,6 @@ const flatConfigProps = [
|
|
|
1679
1679
|
];
|
|
1680
1680
|
const defaultPluginRenaming = {
|
|
1681
1681
|
"@eslint-react": "react",
|
|
1682
|
-
"@tanstack/query": "tanstack-query",
|
|
1683
1682
|
"@typescript-eslint": "ts"
|
|
1684
1683
|
};
|
|
1685
1684
|
function resolveSubOptions(options, key) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncontiero/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.0.0
|
|
5
|
-
"packageManager": "pnpm@10.33.2",
|
|
4
|
+
"version": "8.0.0",
|
|
6
5
|
"description": "Nicolas's ESLint config.",
|
|
7
6
|
"author": {
|
|
8
7
|
"name": "Nicolas Contiero",
|
|
@@ -28,19 +27,6 @@
|
|
|
28
27
|
"publishConfig": {
|
|
29
28
|
"access": "public"
|
|
30
29
|
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "pnpm typegen && tsdown",
|
|
33
|
-
"dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
|
|
34
|
-
"build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
|
|
35
|
-
"typegen": "tsx scripts/typegen.ts",
|
|
36
|
-
"test": "vitest",
|
|
37
|
-
"lint": "eslint .",
|
|
38
|
-
"lint:fix": "pnpm lint --fix",
|
|
39
|
-
"typecheck": "tsc --noEmit",
|
|
40
|
-
"check": "pnpm lint && pnpm typecheck",
|
|
41
|
-
"release": "changeset publish",
|
|
42
|
-
"prepare": "husky"
|
|
43
|
-
},
|
|
44
30
|
"peerDependencies": {
|
|
45
31
|
"@tanstack/eslint-plugin-query": ">=5.50.0",
|
|
46
32
|
"eslint": ">=9.20.0"
|
|
@@ -90,6 +76,7 @@
|
|
|
90
76
|
"@changesets/cli": "^2.31.0",
|
|
91
77
|
"@commitlint/cli": "^20.5.3",
|
|
92
78
|
"@commitlint/config-conventional": "^20.5.3",
|
|
79
|
+
"@eslint/config-inspector": "^2.0.0",
|
|
93
80
|
"@ncontiero/changelog-github": "^2.1.3",
|
|
94
81
|
"@ncontiero/prettier-config": "^1.0.0",
|
|
95
82
|
"@tanstack/eslint-plugin-query": "^5.100.9",
|
|
@@ -112,5 +99,17 @@
|
|
|
112
99
|
"nano-staged": {
|
|
113
100
|
"*": "pnpm lint:fix"
|
|
114
101
|
},
|
|
115
|
-
"prettier": "@ncontiero/prettier-config"
|
|
116
|
-
|
|
102
|
+
"prettier": "@ncontiero/prettier-config",
|
|
103
|
+
"scripts": {
|
|
104
|
+
"build": "pnpm typegen && tsdown",
|
|
105
|
+
"dev": "eslint-config-inspector --config eslint-inspector.config.ts",
|
|
106
|
+
"build:inspector": "pnpm build && eslint-config-inspector build --config eslint-inspector.config.ts",
|
|
107
|
+
"typegen": "tsx scripts/typegen.ts",
|
|
108
|
+
"test": "vitest",
|
|
109
|
+
"lint": "eslint .",
|
|
110
|
+
"lint:fix": "pnpm lint --fix",
|
|
111
|
+
"typecheck": "tsc --noEmit",
|
|
112
|
+
"check": "pnpm lint && pnpm typecheck",
|
|
113
|
+
"release": "changeset publish"
|
|
114
|
+
}
|
|
115
|
+
}
|