@gspothq/cli 0.1.1 → 0.2.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 +58 -11
- package/configurations/database/postgres/manifest.toml +51 -57
- package/configurations/database/postgres/rules/POSTGRES.md +14 -13
- package/configurations/framework/astro/manifest.toml +33 -35
- package/configurations/framework/astro/rules/ASTRO.md +2 -2
- package/configurations/framework/expo/manifest.toml +19 -19
- package/configurations/framework/express/manifest.toml +10 -4
- package/configurations/framework/express/rules/EXPRESS.md +9 -7
- package/configurations/framework/fastapi/manifest.toml +9 -3
- package/configurations/framework/fastapi/rules/FASTAPI.md +19 -18
- package/configurations/framework/nestjs/manifest.toml +12 -12
- package/configurations/framework/nestjs/rules/NESTJS.md +9 -9
- package/configurations/framework/nextjs/manifest.toml +39 -79
- package/configurations/framework/nextjs/rules/NEXTJS.md +9 -7
- package/configurations/framework/nextjs/tool-files/semgrep/nextjs.yml +35 -0
- package/configurations/framework/react/manifest.toml +33 -43
- package/configurations/framework/react/rules/REACT.md +14 -20
- package/configurations/framework/react-dom/manifest.toml +6 -6
- package/configurations/framework/react-native/manifest.toml +11 -11
- package/configurations/framework/react-native/rules/REACT-NATIVE.md +3 -5
- package/configurations/framework/site/manifest.toml +57 -110
- package/configurations/framework/site/rules/SITE.md +1 -1
- package/configurations/framework/svelte/manifest.toml +29 -31
- package/configurations/framework/svelte/rules/SVELTE.md +6 -6
- package/configurations/framework/vue/manifest.toml +37 -37
- package/configurations/framework/vue/rules/VUE.md +6 -6
- package/configurations/general/commits/manifest.toml +20 -84
- package/configurations/general/commits/rules/GIT.md +24 -13
- package/configurations/general/coverage/manifest.toml +1 -1
- package/configurations/general/dependencies/manifest.toml +47 -107
- package/configurations/general/dependencies/rules/DEPENDENCIES.md +13 -7
- package/configurations/general/docs/manifest.toml +28 -43
- package/configurations/general/docs/rules/DOCS.md +16 -9
- package/configurations/general/duplication/manifest.toml +12 -14
- package/configurations/general/engineering/manifest.toml +6 -2
- package/configurations/general/engineering/rules/agent/PLANNING.md +9 -6
- package/configurations/general/engineering/rules/agent/SUPPRESSIONS.md +20 -11
- package/configurations/general/engineering/rules/agent/TASKS.md +6 -2
- package/configurations/general/engineering/rules/agent/WORKING.md +34 -29
- package/configurations/general/engineering/rules/code/ACCESSIBILITY.md +9 -7
- package/configurations/general/engineering/rules/code/CLI.md +12 -9
- package/configurations/general/engineering/rules/code/COMMENTS.md +11 -1
- package/configurations/general/engineering/rules/code/CONFIGURATION.md +2 -0
- package/configurations/general/engineering/rules/code/ERRORS.md +5 -3
- package/configurations/general/engineering/rules/code/HTTP.md +9 -10
- package/configurations/general/engineering/rules/code/LOGGING.md +10 -9
- package/configurations/general/engineering/rules/code/TESTING.md +18 -11
- package/configurations/general/files/manifest.toml +45 -73
- package/configurations/general/files/rules/YAML.md +20 -10
- package/configurations/general/format/manifest.toml +53 -106
- package/configurations/general/gspot/manifest.toml +19 -39
- package/configurations/general/gspot/rules/GENERATED.md +14 -4
- package/configurations/general/licenses/manifest.toml +12 -14
- package/configurations/general/naming/defaults.json +14 -13
- package/configurations/general/naming/manifest.toml +17 -17
- package/configurations/general/naming/rules/NAMING.md +87 -67
- package/configurations/general/prose/manifest.toml +166 -25
- package/configurations/general/prose/rules/WRITING.md +6 -2
- package/configurations/general/repository/manifest.toml +12 -12
- package/configurations/general/secrets/manifest.toml +52 -73
- package/configurations/general/secrets/rules/SECRETS.md +3 -1
- package/configurations/general/security/manifest.toml +29 -52
- package/configurations/general/security/rules/SECURITY.md +8 -6
- package/configurations/general/spelling/manifest.toml +15 -25
- package/configurations/general/structure/manifest.toml +31 -31
- package/configurations/infrastructure/ansible/manifest.toml +15 -15
- package/configurations/infrastructure/docker/manifest.toml +55 -67
- package/configurations/infrastructure/docker/rules/DOCKER.md +15 -13
- package/configurations/infrastructure/github-actions/manifest.toml +21 -41
- package/configurations/infrastructure/github-actions/rules/GITHUB-ACTIONS.md +16 -12
- package/configurations/infrastructure/github-actions/tool-files/zizmor.yml +5 -0
- package/configurations/infrastructure/nginx/manifest.toml +20 -20
- package/configurations/infrastructure/nginx/rules/NGINX.md +5 -4
- package/configurations/infrastructure/openapi/manifest.toml +20 -20
- package/configurations/infrastructure/openapi/rules/OPENAPI.md +3 -1
- package/configurations/infrastructure/xcode/manifest.toml +55 -75
- package/configurations/infrastructure/xcode/rules/XCODE.md +5 -3
- package/configurations/language/bash/manifest.toml +89 -170
- package/configurations/language/bash/rules/BASH.md +79 -17
- package/configurations/language/bash/rules/LANGUAGE.md +30 -26
- package/configurations/language/bash/rules/OPERATIONS.md +10 -8
- package/configurations/language/bash/rules/SAFETY.md +39 -35
- package/configurations/language/css/manifest.toml +22 -61
- package/configurations/language/css/rules/CSS.md +21 -2
- package/configurations/language/css/rules/TAILWIND.md +7 -5
- package/configurations/language/html/manifest.toml +16 -35
- package/configurations/language/html/rules/HTML.md +23 -5
- package/configurations/language/javascript/eslint-runtime-names.json +66 -61
- package/configurations/language/javascript/eslint-runtime.mjs +118 -0
- package/configurations/language/javascript/manifest.toml +135 -207
- package/configurations/language/javascript/rules/BUN.md +2 -2
- package/configurations/language/javascript/rules/COMPONENTS.md +4 -4
- package/configurations/language/javascript/rules/DENO.md +1 -1
- package/configurations/language/javascript/rules/JAVASCRIPT.md +30 -17
- package/configurations/language/javascript/rules/NODE.md +2 -2
- package/configurations/language/javascript/rules/PLAYWRIGHT.md +10 -9
- package/configurations/language/markdown/manifest.toml +20 -51
- package/configurations/language/python/manifest.toml +231 -342
- package/configurations/language/python/rules/DESIGN.md +40 -33
- package/configurations/language/python/rules/FLOW.md +8 -6
- package/configurations/language/python/rules/PACKAGING.md +14 -7
- package/configurations/language/python/rules/PYTHON.md +83 -33
- package/configurations/language/python/rules/TYPING.md +25 -23
- package/configurations/language/sql/manifest.toml +19 -37
- package/configurations/language/sql/rules/SQL.md +90 -2
- package/configurations/language/swift/manifest.toml +67 -78
- package/configurations/language/swift/rules/SWIFT.md +138 -40
- package/configurations/language/swift/rules/SWIFTUI.md +11 -9
- package/configurations/language/swift/rules/UIKIT.md +21 -19
- package/configurations/language/typescript/manifest.toml +34 -34
- package/configurations/language/typescript/rules/TYPESCRIPT.md +62 -10
- package/configurations/library/drizzle/manifest.toml +25 -38
- package/configurations/library/drizzle/rules/DRIZZLE.md +4 -2
- package/configurations/library/react-hook-form/manifest.toml +4 -4
- package/configurations/library/react-hook-form/rules/REACT-HOOK-FORM.md +15 -13
- package/configurations/library/tanstack-query/manifest.toml +6 -6
- package/configurations/library/tanstack-query/rules/TANSTACK-QUERY.md +5 -3
- package/configurations/library/testing-library/manifest.toml +6 -6
- package/configurations/library/translations/manifest.toml +22 -22
- package/configurations/library/translations/rules/NEXT-INTL.md +6 -8
- package/configurations/library/translations/rules/TRANSLATIONS.md +22 -23
- package/configurations/library/trpc/manifest.toml +3 -3
- package/configurations/library/trpc/rules/TRPC.md +8 -6
- package/configurations/library/zod/manifest.toml +6 -6
- package/configurations/library/zod/rules/ZOD.md +4 -2
- package/configurations/library/zustand/manifest.toml +4 -4
- package/configurations/library/zustand/rules/ZUSTAND.md +16 -14
- package/configurations/platform/cloudflare/manifest.toml +28 -47
- package/configurations/platform/cloudflare/rules/CLOUDFLARE.md +11 -6
- package/configurations/platform/supabase/manifest.toml +48 -61
- package/configurations/platform/supabase/rules/SUPABASE.md +27 -28
- package/configurations/testing/jest/manifest.toml +21 -22
- package/configurations/testing/pytest/manifest.toml +28 -28
- package/configurations/testing/swift-tests/manifest.toml +18 -29
- package/configurations/testing/swift-tests/rules/SWIFT-TESTS.md +7 -5
- package/configurations/testing/vitest/manifest.toml +32 -32
- package/configurations/testing/vitest/rules/VITEST.md +3 -1
- package/dist/gspot.js +22297 -24707
- package/dist/{linkinator-program.js → linkinator-process.js} +5 -7
- package/dist/{purgecss-program.js → purgecss-process.js} +12 -12
- package/package.json +7 -9
- package/configurations/infrastructure/github-actions/zizmor.yml +0 -3
- package/configurations/language/bash/rules/NAMING.md +0 -62
- package/configurations/language/css/rules/NAMING.md +0 -17
- package/configurations/language/html/rules/NAMING.md +0 -16
- package/configurations/language/javascript/rules/NAMING.md +0 -31
- package/configurations/language/markdown/markdownlint-cli2.mjs +0 -19
- package/configurations/language/python/rules/NAMING.md +0 -53
- package/configurations/language/sql/rules/NAMING.md +0 -90
- package/configurations/language/swift/rules/NAMING.md +0 -88
- package/configurations/language/typescript/rules/NAMING.md +0 -73
- package/configurations/library/swift-snapshot-testing/manifest.toml +0 -32
- package/dist/THIRD-PARTY-NOTICES.md +0 -25
- package/dist/eslint-rule-levels.json +0 -10
- package/dist/tool-versions.json +0 -3
- package/gspot.schema.json +0 -45991
- /package/{dist/LICENSE.md → LICENSE.md} +0 -0
- /package/configurations/framework/express/{semgrep → tool-files/semgrep}/express.yml +0 -0
- /package/configurations/framework/fastapi/{semgrep → tool-files/semgrep}/fastapi.yml +0 -0
- /package/configurations/general/dependencies/{syncpack.json → tool-files/syncpack.json} +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/LICENSES.md +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/ampm.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/conscious-language.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/contractions.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/currency.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/dashes.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/date-ordinals.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/dates.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/file-paths.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/future.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/hedging.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/history.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/idioms.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/interface-verbs.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/jargon.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/leading-conjunctions.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/link-text.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/locations.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/marketing.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/merge-conflict-markers.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/militaristic-language.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/modals.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/numbered-units.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/obvious-fields.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/ordinal-adverbs.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/percentage-numbers.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/placeholders.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/product-centric-writing.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/punctuated-headings.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/self-reference.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/session-identifiers.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/since.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/straight-quotes.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/suspended-hyphens.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/symbols.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/time-ranges.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/url-prepositions.yml +0 -0
- /package/configurations/general/prose/{vale → tool-files/vale}/styles/gspot/version-range.yml +0 -0
- /package/configurations/general/secrets/{gitleaks.toml → tool-files/gitleaks.toml} +0 -0
- /package/configurations/infrastructure/docker/{trivyignore → tool-files/trivyignore} +0 -0
- /package/configurations/language/bash/{semgrep → tool-files/semgrep}/bash.yml +0 -0
- /package/configurations/language/javascript/{semgrep → tool-files/semgrep}/javascript.yml +0 -0
- /package/configurations/language/swift/{semgrep → tool-files/semgrep}/swift.yml +0 -0
- /package/configurations/platform/cloudflare/{semgrep → tool-files/semgrep}/cloudflare.yml +0 -0
- /package/configurations/platform/supabase/{semgrep → tool-files/semgrep}/supabase.yml +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# UIKit
|
|
2
2
|
|
|
3
|
+
Read this rule when you change UIKit screens, lists, or cells.
|
|
4
|
+
|
|
3
5
|
## Framework boundaries
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
Keep each screen and component in the presentation framework the project chose for it.
|
|
8
|
+
Importing UIKit does not require a SwiftUI migration.
|
|
7
9
|
When the two frameworks meet, use `UIViewRepresentable`, `UIViewControllerRepresentable`, or
|
|
8
10
|
`UIHostingController` at the presentation boundary appropriate to the direction of integration.
|
|
9
11
|
|
|
@@ -14,19 +16,19 @@ without moving network, persistence, or authorization work into reusable views.
|
|
|
14
16
|
|
|
15
17
|
<!-- level: all -->
|
|
16
18
|
|
|
17
|
-
Keep framework types out of domain contracts unless
|
|
19
|
+
Keep framework types out of domain contracts unless they explicitly represent UI.
|
|
18
20
|
Follow declared import boundaries. Put reusable delegate or data-source behavior in a dedicated
|
|
19
|
-
|
|
21
|
+
type when multiple screens need it or the controller mixes unrelated responsibilities.
|
|
20
22
|
A view controller can own a small list's data source and delegate directly.
|
|
21
23
|
|
|
22
|
-
Use
|
|
23
|
-
router, view model, or composition type
|
|
24
|
+
Use the types that build navigation and dependencies. Do not introduce a coordinator,
|
|
25
|
+
router, view model, or composition type only to satisfy a prescribed layout.
|
|
24
26
|
|
|
25
27
|
## View-controller lifecycle
|
|
26
28
|
|
|
27
|
-
Install and constrain owned views through the controller's lifecycle. Balance
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
Install and constrain owned views through the controller's lifecycle. Balance containment
|
|
30
|
+
calls when embedding child controllers. Retain objects whose lifetime the screen owns.
|
|
31
|
+
Cancel asynchronous work the screen owns when its results become irrelevant.
|
|
30
32
|
|
|
31
33
|
An asynchronous result must still belong to the visible item
|
|
32
34
|
or current screen before it changes the UI.
|
|
@@ -35,8 +37,8 @@ or current screen before it changes the UI.
|
|
|
35
37
|
|
|
36
38
|
<!-- level: all -->
|
|
37
39
|
|
|
38
|
-
Large `viewDidLoad`, `viewDidAppear`, app
|
|
39
|
-
setup into named private
|
|
40
|
+
Large `viewDidLoad`, `viewDidAppear`, and app or scene delegate methods move their
|
|
41
|
+
setup into named private functions or composition objects. A mode flag that forces the same
|
|
40
42
|
branching across several methods becomes separate strategy or data source objects or an
|
|
41
43
|
explicit state type. Composition shares UI behavior. Inheritance serves framework
|
|
42
44
|
requirements or stable shared behavior rather than default reuse:
|
|
@@ -48,19 +50,19 @@ tableView.reloadData()
|
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
Preserve supported storyboard, nib, and programmatic construction paths. Mark an initializer
|
|
51
|
-
unavailable only when the
|
|
53
|
+
unavailable only when the construction contract of the component excludes it.
|
|
52
54
|
|
|
53
55
|
## Lists and reusable cells
|
|
54
56
|
|
|
55
57
|
- Retain separately owned data sources and delegates. Table and collection views do not keep
|
|
56
|
-
these weakly referenced
|
|
58
|
+
these weakly referenced objects alive for the screen.
|
|
57
59
|
- Use stable item identifiers. An `IndexPath` identifies a position in the current collection,
|
|
58
60
|
not an item across insertions, removals, or asynchronous work.
|
|
59
61
|
- Look up the current item before handling selection. Do not retain an old index path as identity.
|
|
60
62
|
- Configure every reusable cell's visible and accessibility state for its current item.
|
|
61
63
|
- Cancel or replace image work when the table reuses a cell. Apply a result only when its item identity
|
|
62
|
-
still matches
|
|
63
|
-
- Preserve the relationship between cell registration, dequeueing, and the expected
|
|
64
|
+
still matches.
|
|
65
|
+
- Preserve the relationship between cell registration, dequeueing, and the expected type.
|
|
64
66
|
Do not force-cast unrelated cells to conceal a registration mismatch.
|
|
65
67
|
- Keep list mutations and data-source updates consistent so the view never receives impossible
|
|
66
68
|
row or section counts.
|
|
@@ -69,7 +71,7 @@ unavailable only when the component's actual construction contract excludes it.
|
|
|
69
71
|
|
|
70
72
|
Create a `UICollectionView.CellRegistration` outside the diffable data source's cell-provider
|
|
71
73
|
closure and reuse it for configured dequeueing. Creating it inside that closure prevents cell
|
|
72
|
-
reuse and can raise an exception. See [Apple
|
|
74
|
+
reuse and can raise an exception. See the [Apple cell-registration documentation](https://developer.apple.com/documentation/uikit/uicollectionviewcellregistration?language=swift).
|
|
73
75
|
|
|
74
76
|
### Cell models
|
|
75
77
|
|
|
@@ -78,7 +80,7 @@ reuse and can raise an exception. See [Apple's cell-registration documentation](
|
|
|
78
80
|
Pass cells the values needed for rendering and interaction. Keep provider records and database
|
|
79
81
|
mechanics at their existing boundary. Use a feature-owned enum for a closed set of heterogeneous
|
|
80
82
|
rows when it makes the relationship explicit. Add a shared configurator only for repeated
|
|
81
|
-
behavior that
|
|
83
|
+
behavior that registration APIs do not already own.
|
|
82
84
|
|
|
83
85
|
## Diffable data sources
|
|
84
86
|
|
|
@@ -87,13 +89,13 @@ unique and stable across snapshots. Do not identify an item by mutable display t
|
|
|
87
89
|
|
|
88
90
|
Build each snapshot from a consistent state. Resolve cells and selection through the current
|
|
89
91
|
data source. When you write tests, cover insertion, removal, reordering, and asynchronous refresh
|
|
90
|
-
|
|
92
|
+
if the screen owns those transitions. Keep snapshot-building code with the presentation behavior
|
|
91
93
|
it serves.
|
|
92
94
|
|
|
93
95
|
## Accessibility and interaction
|
|
94
96
|
|
|
95
97
|
Expose meaningful values, traits, and actions, and keep accessibility state correct after cell
|
|
96
|
-
reuse and snapshot updates. When you write tests, cover focus and selection
|
|
98
|
+
reuse and snapshot updates. When you write tests, cover focus and selection after content changes
|
|
97
99
|
or a modal screen closes.
|
|
98
100
|
|
|
99
101
|
Use constraints that fit Dynamic Type, safe areas, and every supported size class.
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
allowed_words = ["TypeScript"]
|
|
2
2
|
|
|
3
|
-
[prefix_collisions]
|
|
4
|
-
prefixes = ["tsconfig"]
|
|
5
|
-
|
|
6
3
|
[configuration]
|
|
7
|
-
|
|
4
|
+
description = "The strict compiler, ESLint with typescript-eslint and the gspot structural rules over every TypeScript file, and knip for dead code."
|
|
8
5
|
requires = ["javascript"]
|
|
9
6
|
suggests = []
|
|
10
|
-
|
|
7
|
+
title = "TypeScript"
|
|
11
8
|
|
|
12
9
|
[detect]
|
|
13
10
|
extensions = [".ts", ".tsx", ".mts", ".cts"]
|
|
@@ -17,43 +14,21 @@ filenames = ["tsconfig.json"]
|
|
|
17
14
|
extensions = [".ts", ".tsx", ".mts", ".cts", ".d.ts"]
|
|
18
15
|
filenames = ["tsconfig.json", "tsconfig.*.json"]
|
|
19
16
|
|
|
17
|
+
[shared_prefixes]
|
|
18
|
+
prefixes = ["tsconfig"]
|
|
19
|
+
|
|
20
20
|
[[tool]]
|
|
21
|
+
kind = "library"
|
|
21
22
|
name = "typescript-eslint"
|
|
23
|
+
npm = "typescript-eslint"
|
|
22
24
|
requires = ["tsc"]
|
|
23
25
|
rule_prefix = "@typescript-eslint"
|
|
24
26
|
rule_url = "https://typescript-eslint.io/rules/{rule}"
|
|
25
|
-
kind = "library"
|
|
26
27
|
version = "8.70.0"
|
|
27
|
-
npm = "typescript-eslint"
|
|
28
28
|
|
|
29
29
|
[tool.eslint]
|
|
30
30
|
extensions = [".ts", ".tsx", ".mts", ".cts"]
|
|
31
31
|
|
|
32
|
-
[[check]]
|
|
33
|
-
name = "tsc"
|
|
34
|
-
example = "The TypeScript declaration `const count: number = \"one\";` reports an incompatible assignment. Correct it to `const count: number = 1;` when the contract requires a number."
|
|
35
|
-
level = "recommended"
|
|
36
|
-
stage = "push"
|
|
37
|
-
runs = "scope"
|
|
38
|
-
cwd = "scope"
|
|
39
|
-
tool = "tsc"
|
|
40
|
-
summary = "Checks that every TypeScript file type-checks with the strict compiler options."
|
|
41
|
-
why = "A file that does not type-check can crash at run time in a way the editor already knew about."
|
|
42
|
-
help = "Read the first error tsc prints and fix that file; later errors are often the same mistake."
|
|
43
|
-
|
|
44
|
-
[check.output]
|
|
45
|
-
format = "regex"
|
|
46
|
-
pattern = "^(?<file>[^(]+)\\((?<line>\\d+),(?<column>\\d+)\\): error (?<rule>TS\\d+): (?<message>.*)$"
|
|
47
|
-
|
|
48
|
-
[[check]]
|
|
49
|
-
name = "tsconfig"
|
|
50
|
-
example = "Your TypeScript configuration setting `strict` to `false` reports the required compiler option. Enable `strict` and fix the type errors it reports."
|
|
51
|
-
level = "recommended"
|
|
52
|
-
stage = "commit"
|
|
53
|
-
summary = "Requires strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride, and noFallthroughCasesInSwitch in every tsconfig you write. Level all also requires noImplicitReturns and noPropertyAccessFromIndexSignature."
|
|
54
|
-
why = "One tsconfig that drops strict lets untyped code back in for that whole scope."
|
|
55
|
-
help = "Enable the reported compiler option in your TypeScript configuration."
|
|
56
|
-
|
|
57
32
|
[eslint]
|
|
58
33
|
all_level_rules = ["@typescript-eslint/ban-ts-comment", "@typescript-eslint/consistent-type-definitions", "@typescript-eslint/consistent-type-exports", "@typescript-eslint/consistent-type-imports", "@typescript-eslint/explicit-module-boundary-types", "@typescript-eslint/no-explicit-any", "@typescript-eslint/no-extraneous-class", "@typescript-eslint/no-magic-numbers", "@typescript-eslint/no-mixed-enums", "@typescript-eslint/no-namespace", "@typescript-eslint/no-non-null-assertion", "@typescript-eslint/no-require-imports", "@typescript-eslint/no-this-alias", "@typescript-eslint/no-unnecessary-type-parameters", "@typescript-eslint/prefer-readonly", "@typescript-eslint/prefer-reduce-type-parameter", "@typescript-eslint/prefer-return-this-type", "@typescript-eslint/strict-boolean-expressions", "@typescript-eslint/triple-slash-reference", "@typescript-eslint/unified-signatures"]
|
|
59
34
|
|
|
@@ -66,7 +41,32 @@ package = "typescript-eslint"
|
|
|
66
41
|
source = "configs.disableTypeChecked"
|
|
67
42
|
|
|
68
43
|
[[tool_file]]
|
|
69
|
-
target = ".gspot/config/eslint.config.mjs"
|
|
70
|
-
tool = "eslint"
|
|
71
44
|
fragment = true
|
|
72
45
|
required_tools = ["typescript-eslint"]
|
|
46
|
+
target = ".gspot/config/eslint.config.mjs"
|
|
47
|
+
tool = "eslint"
|
|
48
|
+
|
|
49
|
+
[[check]]
|
|
50
|
+
cwd = "scope"
|
|
51
|
+
example = "`const count: number = \"one\";` reports an incompatible assignment. Assign a number, such as `const count: number = 1;`."
|
|
52
|
+
help = "Fix the first error tsc prints; later errors often come from the same mistake."
|
|
53
|
+
level = "recommended"
|
|
54
|
+
name = "tsc"
|
|
55
|
+
runs = "scope"
|
|
56
|
+
stage = "push"
|
|
57
|
+
summary = "Runs tsc with the strict compiler options over every TypeScript file."
|
|
58
|
+
tool = "tsc"
|
|
59
|
+
why = "A type error left in a file can crash the program at run time, though the editor already showed it."
|
|
60
|
+
|
|
61
|
+
[check.output]
|
|
62
|
+
format = "regex"
|
|
63
|
+
pattern = "^(?<file>[^(]+)\\((?<line>\\d+),(?<column>\\d+)\\): error (?<rule>TS\\d+): (?<message>.*)$"
|
|
64
|
+
|
|
65
|
+
[[check]]
|
|
66
|
+
example = "A tsconfig with `strict` set to `false` reports a finding. Set `strict` to `true`, and fix the new type errors."
|
|
67
|
+
help = "Turn on the reported compiler option in your tsconfig."
|
|
68
|
+
level = "recommended"
|
|
69
|
+
name = "tsconfig"
|
|
70
|
+
stage = "commit"
|
|
71
|
+
summary = "Requires strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride, and noFallthroughCasesInSwitch in every tsconfig you write. Level all also requires noImplicitReturns and noPropertyAccessFromIndexSignature."
|
|
72
|
+
why = "One tsconfig that drops strict lets untyped code back in for that whole scope."
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
# TypeScript
|
|
2
2
|
|
|
3
|
+
Read this rule when you change TypeScript code.
|
|
4
|
+
|
|
3
5
|
TypeScript checks static types. JavaScript and runtime rules cover modules and execution.
|
|
4
6
|
|
|
5
7
|
## Philosophy
|
|
6
8
|
|
|
7
9
|
TypeScript makes types explicit at compile time. Plain values, small functions, discriminated
|
|
8
|
-
unions, and clear modules
|
|
10
|
+
unions, and clear modules read better than elaborate type transformations.
|
|
9
11
|
|
|
10
12
|
## Files and modules
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
Error output and process exits stay at executable boundaries. Before you assume a lint rule
|
|
15
|
+
applies to a path, check the effective configuration.
|
|
16
|
+
|
|
17
|
+
Do not edit compiler output with string replacement. Change the source or the compiler options, then ship the
|
|
18
|
+
output.
|
|
15
19
|
|
|
16
20
|
## Values and shapes
|
|
17
21
|
|
|
@@ -34,14 +38,14 @@ missing fields, and nulls where they enter the program.
|
|
|
34
38
|
|
|
35
39
|
## Functions and classes
|
|
36
40
|
|
|
37
|
-
Annotate callback parameters when inference
|
|
41
|
+
Annotate callback parameters when inference gives no clear type, rely on it for local details,
|
|
38
42
|
and keep generics minimal. A discriminated union or options object replaces overloads when
|
|
39
|
-
clearer. Make a parameter optional only
|
|
43
|
+
clearer. Make a parameter optional only when callers can omit the input.
|
|
40
44
|
|
|
41
45
|
## Errors and async work
|
|
42
46
|
|
|
43
47
|
`Promise.all` serves bounded independent fan-out. Order, rate limits, or failure isolation
|
|
44
|
-
call for sequential `await`. Large fan-out, provider calls, and batch work use
|
|
48
|
+
call for sequential `await`. Large fan-out, provider calls, and batch work use runtime
|
|
45
49
|
concurrency utilities. Detach a promise only deliberately. Log and supervise it; never swallow a rejection.
|
|
46
50
|
|
|
47
51
|
This fragment uses the message and provider types, persistence functions, and lock operations
|
|
@@ -73,7 +77,55 @@ export async function createProviderOperation(request: ProviderOperationRequest)
|
|
|
73
77
|
}
|
|
74
78
|
```
|
|
75
79
|
|
|
76
|
-
##
|
|
80
|
+
## Naming
|
|
81
|
+
|
|
82
|
+
### TypeScript files and modules
|
|
83
|
+
|
|
84
|
+
<!-- level: all -->
|
|
85
|
+
|
|
86
|
+
- Do not use namespaces, `module`, triple-slash references, or
|
|
87
|
+
`import x = require(...)` to simulate ownership.
|
|
88
|
+
- Keep generator-style file names only for generator output.
|
|
89
|
+
|
|
90
|
+
### TypeScript variables
|
|
91
|
+
|
|
92
|
+
<!-- level: all -->
|
|
93
|
+
|
|
94
|
+
- Use explanatory destructuring names.
|
|
95
|
+
|
|
96
|
+
For a range comparison, name the value `value` and the bounds `minimum` and
|
|
97
|
+
`maximum`. Use a type that supports the comparison, such as `number`; an
|
|
98
|
+
unconstrained generic does not establish ordering semantics.
|
|
99
|
+
|
|
100
|
+
When iterating a map of users, destructure its entries as `[userId, user]`
|
|
101
|
+
instead of naming each pair `keyValue`.
|
|
102
|
+
|
|
103
|
+
Name a reused daily timer duration `MILLISECONDS_PER_DAY` and define it as
|
|
104
|
+
`86_400_000`. The name explains both the interval and its unit.
|
|
105
|
+
|
|
106
|
+
### TypeScript functions
|
|
107
|
+
|
|
108
|
+
<!-- level: all -->
|
|
109
|
+
|
|
110
|
+
- Use async/await in names only to distinguish a function from a blocking counterpart. The return type already shows async.
|
|
111
|
+
|
|
112
|
+
### TypeScript types
|
|
113
|
+
|
|
114
|
+
<!-- level: all -->
|
|
115
|
+
|
|
116
|
+
- Use plain and discriminated unions for alternatives.
|
|
117
|
+
- Use interfaces only when a framework contract, declaration merging, or
|
|
118
|
+
`implements` relationship makes one the clearest tool.
|
|
119
|
+
- Use optional fields for values callers can omit.
|
|
120
|
+
- Avoid return-type-only generics. When you call an existing one, specify the
|
|
121
|
+
type argument explicitly.
|
|
122
|
+
- Give the keys of an index signature meaningful names.
|
|
123
|
+
- Prefer `Map` for key/value operations.
|
|
124
|
+
|
|
125
|
+
Name a coffee response union `CoffeeResponse`; put `| undefined` on an
|
|
126
|
+
operation that can return nothing. Name a user index `UsersById` and its
|
|
127
|
+
key `userId`.
|
|
77
128
|
|
|
78
|
-
|
|
79
|
-
|
|
129
|
+
A function that selects a collection element ties its generic to the input.
|
|
130
|
+
Its return contract must account for an empty collection unless
|
|
131
|
+
the input type or validation proves that an element exists.
|
|
@@ -1,68 +1,55 @@
|
|
|
1
1
|
allowed_words = ["Drizzle"]
|
|
2
2
|
|
|
3
3
|
[configuration]
|
|
4
|
-
|
|
4
|
+
description = "Drizzle: no update or delete without `where`, raw SQL only at paths the settings allow, and migrations that match the schema."
|
|
5
5
|
requires = ["javascript"]
|
|
6
|
-
|
|
6
|
+
title = "Drizzle"
|
|
7
7
|
|
|
8
8
|
[detect]
|
|
9
9
|
dependencies = ["drizzle-orm"]
|
|
10
10
|
|
|
11
|
+
[rules."DRIZZLE.md"]
|
|
12
|
+
dependencies = ["pg", "postgres"]
|
|
13
|
+
|
|
11
14
|
[[tool]]
|
|
15
|
+
kind = "library"
|
|
12
16
|
name = "eslint-plugin-drizzle"
|
|
17
|
+
npm = "eslint-plugin-drizzle"
|
|
13
18
|
rule_prefix = "drizzle"
|
|
14
|
-
kind = "library"
|
|
15
19
|
version = "0.2.3"
|
|
16
|
-
npm = "eslint-plugin-drizzle"
|
|
17
20
|
|
|
18
21
|
[[tool]]
|
|
19
|
-
name = "drizzle-kit"
|
|
20
22
|
install_hint = "Run: npm install --save-dev drizzle-kit"
|
|
21
|
-
system = true
|
|
22
|
-
version_command = ["--version"]
|
|
23
23
|
min_version = "0.21.0"
|
|
24
|
+
name = "drizzle-kit"
|
|
24
25
|
npm = "drizzle-kit"
|
|
26
|
+
system = true
|
|
27
|
+
version_command = ["--version"]
|
|
25
28
|
|
|
26
|
-
[[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
level = "all"
|
|
30
|
-
stage = "commit"
|
|
31
|
-
runs = "scope"
|
|
32
|
-
summary = "Checks that every table with a reference has a relations entry."
|
|
33
|
-
why = "Relational queries through `db.query` read relations. SQL joins do not need them."
|
|
34
|
-
help = "Add a relations call for the table."
|
|
29
|
+
[[eslint.selectors]]
|
|
30
|
+
message = "Raw SQL skips the types of the schema. Use the query builder, or accept this finding with a rule-specific ignore."
|
|
31
|
+
selector = "TaggedTemplateExpression[tag.name='sql']"
|
|
35
32
|
|
|
36
|
-
[
|
|
37
|
-
|
|
33
|
+
[[tool_file]]
|
|
34
|
+
fragment = true
|
|
35
|
+
required_tools = ["eslint-plugin-drizzle"]
|
|
36
|
+
target = ".gspot/config/eslint.config.mjs"
|
|
37
|
+
tool = "eslint"
|
|
38
38
|
|
|
39
39
|
[[check]]
|
|
40
|
-
name = "stale-migrations"
|
|
41
40
|
command = ["drizzle-kit", "generate"]
|
|
42
|
-
example = "
|
|
41
|
+
example = "A schema change with no new migration reports drift. Run `drizzle-kit generate`, review the migration, and commit it."
|
|
42
|
+
help = "Run `drizzle-kit generate` and commit the migration."
|
|
43
43
|
level = "recommended"
|
|
44
|
-
|
|
44
|
+
name = "stale-migrations"
|
|
45
45
|
runs = "scope"
|
|
46
|
+
stage = "push"
|
|
47
|
+
summary = "Runs `drizzle-kit generate` and fails when it creates a migration."
|
|
46
48
|
tool = "drizzle-kit"
|
|
47
|
-
|
|
48
|
-
why = "A schema change with no migration works on the machine that pushed the schema and nowhere else."
|
|
49
|
-
help = "Run drizzle-kit generate and commit the migration."
|
|
49
|
+
why = "A schema change with no migration works only on the machine that pushed it."
|
|
50
50
|
|
|
51
|
-
[[check.
|
|
51
|
+
[[check.generator_outputs]]
|
|
52
52
|
pattern = "**/*"
|
|
53
53
|
|
|
54
54
|
[check.files]
|
|
55
55
|
paths = ["drizzle.config.ts", "drizzle.config.js", "drizzle.config.mts", "drizzle.config.mjs", "drizzle.config.cts", "drizzle.config.cjs"]
|
|
56
|
-
|
|
57
|
-
[rules."DRIZZLE.md"]
|
|
58
|
-
dependencies = ["pg", "postgres"]
|
|
59
|
-
|
|
60
|
-
[[eslint.selectors]]
|
|
61
|
-
selector = "TaggedTemplateExpression[tag.name='sql']"
|
|
62
|
-
message = "Raw SQL skips the types of the schema. Use the query builder, or accept this finding with a rule-specific ignore."
|
|
63
|
-
|
|
64
|
-
[[tool_file]]
|
|
65
|
-
target = ".gspot/config/eslint.config.mjs"
|
|
66
|
-
tool = "eslint"
|
|
67
|
-
fragment = true
|
|
68
|
-
required_tools = ["eslint-plugin-drizzle"]
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Drizzle
|
|
2
2
|
|
|
3
|
+
Read this rule when you change Drizzle schemas, queries, or migrations.
|
|
4
|
+
|
|
3
5
|
These decisions cover Drizzle with PostgreSQL. Use the adapter and APIs of the installed release.
|
|
4
|
-
|
|
6
|
+
Connection and identity decisions for Supabase stay in its rules.
|
|
5
7
|
|
|
6
8
|
## Connections and schema ownership
|
|
7
9
|
|
|
@@ -20,7 +22,7 @@ and [relations](https://orm.drizzle.team/docs/relations).
|
|
|
20
22
|
## Authorized operations
|
|
21
23
|
|
|
22
24
|
Select only the fields the caller may see. Apply resource and tenant restrictions in the query or
|
|
23
|
-
an enforced policy. A row identifier proves no permission, and an inferred insert type
|
|
25
|
+
an enforced policy. A row identifier proves no permission, and an inferred insert type allows
|
|
24
26
|
fields a public request must not set. Keep public schemas apart from persistence types.
|
|
25
27
|
|
|
26
28
|
Scope writes to the authorized resource and verify affected rows. Bound growing collections and
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
[configuration]
|
|
2
|
-
|
|
2
|
+
description = "React Hook Form: each form validates through a resolver, and no registered field also acts as a controlled one."
|
|
3
3
|
requires = ["javascript"]
|
|
4
|
-
|
|
4
|
+
title = "React Hook Form"
|
|
5
5
|
|
|
6
6
|
[detect]
|
|
7
7
|
dependencies = ["react-hook-form"]
|
|
8
8
|
|
|
9
9
|
[[eslint.selectors]]
|
|
10
|
-
selector = "CallExpression[callee.name='useForm']:not(:has(Property[key.name='resolver']))"
|
|
11
10
|
message = "Give useForm a resolver, so the schema that types the form also validates it."
|
|
11
|
+
selector = "CallExpression[callee.name='useForm']:not(:has(Property[key.name='resolver']))"
|
|
12
12
|
|
|
13
13
|
[[eslint.selectors]]
|
|
14
|
-
selector = "JSXOpeningElement:has(JSXSpreadAttribute CallExpression[callee.name=register]):has(JSXAttribute[name.name=value]):not(:has([name.name=type]>[value=/^(checkbox|radio)$/]))"
|
|
15
14
|
message = "Drop value or use Controller."
|
|
15
|
+
selector = "JSXOpeningElement:has(JSXSpreadAttribute CallExpression[callee.name=register]):has(JSXAttribute[name.name=value]):not(:has([name.name=type]>[value=/^(checkbox|radio)$/]))"
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
# React Hook Form
|
|
2
2
|
|
|
3
|
+
Read this rule when you change a form built with React Hook Form.
|
|
4
|
+
|
|
3
5
|
## Form ownership and validation
|
|
4
6
|
|
|
5
|
-
- One `useForm` instance owns a form. Use `FormProvider` when nested fields need
|
|
6
|
-
never create a second
|
|
7
|
+
- One `useForm` instance owns a form. Use `FormProvider` when nested fields need it;
|
|
8
|
+
never create a second `useForm` instance for the same submission.
|
|
7
9
|
- The resolver owns schema validation. Keep coercion and validation in that path rather than
|
|
8
10
|
maintaining competing rules in fields and submit handlers.
|
|
9
11
|
- Initialize `defaultValues` with the form's complete starting values. Reset deliberately when the
|
|
10
|
-
edited record
|
|
12
|
+
edited record switches; an incoming background response must not discard a user's changes.
|
|
11
13
|
- An input uses either `register` or `Controller`. A controlled widget forwards the controller's
|
|
12
|
-
value, change
|
|
14
|
+
value, change and blur handlers, ref, and disabled state through its supported interface.
|
|
13
15
|
- Subscribe through `useWatch` or `useFormState` near the consumer instead of making the entire form
|
|
14
16
|
rerender for every field. `getValues` reads a snapshot rather than subscribing.
|
|
15
|
-
- Conditional fields
|
|
17
|
+
- Conditional fields separate hidden values that stay in the submission from ones that
|
|
16
18
|
need removal. The schema follows that choice.
|
|
17
19
|
|
|
18
20
|
## Field arrays
|
|
19
21
|
|
|
20
|
-
- Give each field array one `useFieldArray`
|
|
22
|
+
- Give each field array one `useFieldArray` call. Use `field.id` as the React key and the current
|
|
21
23
|
index in a registered path. Store database identity in a separate property.
|
|
22
|
-
- Treat `fields` as row structure. Read live values through the form's
|
|
24
|
+
- Treat `fields` as row structure. Read live values through the form's APIs.
|
|
23
25
|
- Add complete rows. Use a leaf `setValue` when an update must preserve the mounted row's focus and
|
|
24
|
-
widget state; `update` remounts
|
|
25
|
-
- Keep one
|
|
26
|
+
widget state; `update` remounts it.
|
|
27
|
+
- Keep one `useForm` instance across wizard steps. Validate a step before advancing and the whole payload
|
|
26
28
|
before the final submission.
|
|
27
29
|
|
|
28
30
|
## Submission and errors
|
|
29
31
|
|
|
30
32
|
- The submit handler awaits the real save. Pending state lasts until that operation settles;
|
|
31
33
|
starting a request and returning early makes `isSubmitting` misleading.
|
|
32
|
-
-
|
|
34
|
+
- Show field errors beside their inputs and form errors at the boundary. Keep entered values
|
|
33
35
|
after a failed save so the user can correct or retry them.
|
|
34
36
|
- A save captures the edited record's identity. Its late result must not reset a different record.
|
|
35
|
-
- When the project uses TanStack Query
|
|
37
|
+
- When the project uses TanStack Query and submission needs the mutation result, await `mutateAsync`.
|
|
36
38
|
Handle its rejection in the form's error path.
|
|
37
39
|
- When the project uses Next.js Server Actions, await the action and map its returned validation or
|
|
38
40
|
save result into the form's error state.
|
|
39
|
-
- When the project uses an internationalization library, pass error messages through
|
|
40
|
-
message API rather than
|
|
41
|
+
- When the project uses an internationalization library, pass error messages through its
|
|
42
|
+
message API rather than building translated sentences from fragments.
|
|
41
43
|
|
|
42
44
|
## References
|
|
43
45
|
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
allowed_words = ["TanStack"]
|
|
2
2
|
|
|
3
3
|
[configuration]
|
|
4
|
-
|
|
4
|
+
description = "TanStack Query: ESLint rules for dependency lists, stable clients, and the order of options."
|
|
5
5
|
requires = ["javascript"]
|
|
6
|
-
|
|
6
|
+
title = "TanStack Query"
|
|
7
7
|
|
|
8
8
|
[detect]
|
|
9
9
|
dependencies = ["@tanstack/react-query", "@tanstack/query-core", "@tanstack/vue-query", "@tanstack/svelte-query", "@tanstack/solid-query", "@tanstack/angular-query-experimental"]
|
|
10
10
|
|
|
11
11
|
[[tool]]
|
|
12
|
+
kind = "library"
|
|
12
13
|
name = "@tanstack/eslint-plugin-query"
|
|
14
|
+
npm = "@tanstack/eslint-plugin-query"
|
|
13
15
|
rule_prefix = "@tanstack/query"
|
|
14
|
-
kind = "library"
|
|
15
16
|
version = "5.91.2"
|
|
16
|
-
npm = "@tanstack/eslint-plugin-query"
|
|
17
17
|
|
|
18
18
|
[eslint.presets.recommended]
|
|
19
19
|
package = "@tanstack/eslint-plugin-query"
|
|
20
20
|
source = "configs.flat/recommended"
|
|
21
21
|
|
|
22
22
|
[[tool_file]]
|
|
23
|
-
target = ".gspot/config/eslint.config.mjs"
|
|
24
|
-
tool = "eslint"
|
|
25
23
|
fragment = true
|
|
26
24
|
required_tools = ["@tanstack/eslint-plugin-query"]
|
|
25
|
+
target = ".gspot/config/eslint.config.mjs"
|
|
26
|
+
tool = "eslint"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# TanStack Query
|
|
2
2
|
|
|
3
|
+
Read this rule when you change TanStack Query queries, mutations, or cache keys.
|
|
4
|
+
|
|
3
5
|
Use the integration and release the project has. Query data stays in its cache; do not copy it
|
|
4
6
|
into a second store to share it with another component.
|
|
5
7
|
|
|
@@ -10,14 +12,14 @@ initial suspension. Clear or partition private state when identity or tenant cha
|
|
|
10
12
|
response must not refill the next session's cache.
|
|
11
13
|
|
|
12
14
|
Include every result-changing input in the key. Give list previews, detail records, and infinite
|
|
13
|
-
pages different identities. When the project
|
|
15
|
+
pages different identities. When the project has tRPC, use its generated options and key factories.
|
|
14
16
|
Keep prefetch and consumption on the same keys and serialization contract; dehydrate no private data.
|
|
15
17
|
|
|
16
18
|
See [server rendering and hydration](https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr).
|
|
17
19
|
|
|
18
20
|
## Writes and recovery
|
|
19
21
|
|
|
20
|
-
Apply a save result to the resource captured
|
|
22
|
+
Apply a save result to the resource captured at its start, not the current selection.
|
|
21
23
|
An optimistic rollback reverses only its own change; restoring a whole snapshot can erase a newer
|
|
22
24
|
success. Reconcile with the committed response, then invalidate affected lists and aggregates.
|
|
23
25
|
A committed write stays successful when its refresh fails.
|
|
@@ -33,7 +35,7 @@ Distinguish first load, background refresh, and next-page loading. Keep useful d
|
|
|
33
35
|
a refresh and expose its failure separately. A placeholder supplies display data, not a record ready
|
|
34
36
|
for editing. Reset placeholders and pagination when identity or filters change.
|
|
35
37
|
|
|
36
|
-
Choose freshness from the resource's risk. Never disable refetching globally to
|
|
38
|
+
Choose freshness from the resource's risk. Never disable refetching globally to hide duplicate
|
|
37
39
|
requests. Keep permission and account state out of static caches. Preserve both `pages` and
|
|
38
40
|
`pageParams` when changing an infinite query.
|
|
39
41
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
[configuration]
|
|
2
|
-
|
|
2
|
+
description = "Lint rules for test files in projects that depend on Testing Library."
|
|
3
3
|
requires = ["javascript"]
|
|
4
|
-
|
|
4
|
+
title = "Testing Library"
|
|
5
5
|
|
|
6
6
|
[detect]
|
|
7
7
|
dependencies = ["@testing-library/*"]
|
|
8
8
|
|
|
9
9
|
[[tool]]
|
|
10
|
+
kind = "library"
|
|
10
11
|
name = "eslint-plugin-testing-library"
|
|
12
|
+
npm = "eslint-plugin-testing-library"
|
|
11
13
|
rule_prefix = "testing-library"
|
|
12
|
-
kind = "library"
|
|
13
14
|
version = "7.16.2"
|
|
14
|
-
npm = "eslint-plugin-testing-library"
|
|
15
15
|
|
|
16
16
|
[eslint]
|
|
17
17
|
all_level_rules = ["testing-library/no-container", "testing-library/no-node-access", "testing-library/no-render-in-lifecycle", "testing-library/prefer-screen-queries", "testing-library/render-result-naming-convention"]
|
|
@@ -41,7 +41,7 @@ package = "eslint-plugin-testing-library"
|
|
|
41
41
|
source = "configs.flat/marko"
|
|
42
42
|
|
|
43
43
|
[[tool_file]]
|
|
44
|
-
target = ".gspot/config/eslint.config.mjs"
|
|
45
|
-
tool = "eslint"
|
|
46
44
|
fragment = true
|
|
47
45
|
required_tools = ["eslint-plugin-testing-library"]
|
|
46
|
+
target = ".gspot/config/eslint.config.mjs"
|
|
47
|
+
tool = "eslint"
|