Skip to content

Commit 8a6a2a2

Browse files
ci: run prettier autofix action (#972)
* ci: prettier auto-fix * Sync prettier config with other TanStack projects * Fix lockfile
1 parent 9dba1c1 commit 8a6a2a2

File tree

460 files changed

+5753
-5767
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

460 files changed

+5753
-5767
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
name: 🐛 Bug Report
33
about: Create a report to help us improve
4-
title: ""
5-
labels: ""
6-
assignees: ""
4+
title: ''
5+
labels: ''
6+
assignees: ''
77
---
88

99
- [ ] I've validated the bug against the latest version of DB packages

.github/workflows/autofix.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ jobs:
2424
- name: Setup Tools
2525
uses: tanstack/config/.github/setup@main
2626
- name: Fix formatting
27-
run: pnpm prettier --ignore-unknown . --check
28-
- name: Run ESLint
29-
run: pnpm run lint
27+
run: pnpm format
3028
- name: Apply fixes
3129
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
3230
with:
33-
commit-message: "ci: apply automated fixes"
31+
commit-message: 'ci: apply automated fixes'

.github/workflows/docs-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Sync Generated Docs
33
on:
44
schedule:
55
# Run daily at 2 AM UTC
6-
- cron: "0 2 * * *"
6+
- cron: '0 2 * * *'
77

88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:

.github/workflows/e2e-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
- name: Setup Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: "20"
27-
cache: "pnpm"
26+
node-version: '20'
27+
cache: 'pnpm'
2828

2929
- name: Install dependencies
3030
run: pnpm install --frozen-lockfile

.github/workflows/pr.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ jobs:
5151
- name: Compressed Size Action - DB Package
5252
uses: preactjs/compressed-size-action@v2
5353
with:
54-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
55-
pattern: "./packages/db/dist/**/*.{js,mjs}"
56-
comment-key: "db-package-size"
57-
build-script: "build:minified"
54+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
55+
pattern: './packages/db/dist/**/*.{js,mjs}'
56+
comment-key: 'db-package-size'
57+
build-script: 'build:minified'
5858
- name: Compressed Size Action - React DB Package
5959
uses: preactjs/compressed-size-action@v2
6060
with:
61-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
62-
pattern: "./packages/react-db/dist/**/*.{js,mjs}"
63-
comment-key: "react-db-package-size"
64-
build-script: "build:minified"
61+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
62+
pattern: './packages/react-db/dist/**/*.{js,mjs}'
63+
comment-key: 'react-db-package-size'
64+
build-script: 'build:minified'
6565
build-example:
6666
name: Build Example Site
6767
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
version: pnpm run changeset:version
3838
publish: pnpm run changeset:publish
39-
commit: "ci: Version Packages"
40-
title: "ci: Version Packages"
39+
commit: 'ci: Version Packages'
40+
title: 'ci: Version Packages'
4141
env:
4242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.pnpmfile.cjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
function readPackage(pkg, context) {
22
// Force all @tanstack/db dependencies to resolve to workspace version
3-
if (pkg.dependencies && pkg.dependencies["@tanstack/db"]) {
4-
pkg.dependencies["@tanstack/db"] = "workspace:*"
3+
if (pkg.dependencies && pkg.dependencies['@tanstack/db']) {
4+
pkg.dependencies['@tanstack/db'] = 'workspace:*'
55
context.log(`Overriding @tanstack/db dependency in ${pkg.name}`)
66
}
77

8-
if (pkg.devDependencies && pkg.devDependencies["@tanstack/db"]) {
9-
pkg.devDependencies["@tanstack/db"] = "workspace:*"
8+
if (pkg.devDependencies && pkg.devDependencies['@tanstack/db']) {
9+
pkg.devDependencies['@tanstack/db'] = 'workspace:*'
1010
context.log(`Overriding @tanstack/db devDependency in ${pkg.name}`)
1111
}
1212

13-
if (pkg.peerDependencies && pkg.peerDependencies["@tanstack/db"]) {
14-
pkg.peerDependencies["@tanstack/db"] = "workspace:*"
13+
if (pkg.peerDependencies && pkg.peerDependencies['@tanstack/db']) {
14+
pkg.peerDependencies['@tanstack/db'] = 'workspace:*'
1515
context.log(`Overriding @tanstack/db peerDependency in ${pkg.name}`)
1616
}
1717

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

AGENTS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function processData(data: unknown) {
3636
if (isDataObject(data)) {
3737
return data.value
3838
}
39-
throw new Error("Invalid data")
39+
throw new Error('Invalid data')
4040
}
4141

4242
const result: TQueryData = someOperation()
@@ -58,12 +58,12 @@ const result: TQueryData = someOperation()
5858
```typescript
5959
// Duplicated logic in multiple places
6060
function processA() {
61-
const key = typeof value === "number" ? `__number__${value}` : String(value)
61+
const key = typeof value === 'number' ? `__number__${value}` : String(value)
6262
// ...
6363
}
6464

6565
function processB() {
66-
const key = typeof value === "number" ? `__number__${value}` : String(value)
66+
const key = typeof value === 'number' ? `__number__${value}` : String(value)
6767
// ...
6868
}
6969
```
@@ -72,7 +72,7 @@ function processB() {
7272

7373
```typescript
7474
function serializeKey(value: string | number): string {
75-
return typeof value === "number" ? `__number__${value}` : String(value)
75+
return typeof value === 'number' ? `__number__${value}` : String(value)
7676
}
7777

7878
function processA() {
@@ -161,7 +161,7 @@ readyJobs.forEach(processJob)
161161

162162
```typescript
163163
// O(n) lookup for each check
164-
const items = ["foo", "bar", "baz" /* hundreds more */]
164+
const items = ['foo', 'bar', 'baz' /* hundreds more */]
165165
if (items.includes(searchValue)) {
166166
// ...
167167
}
@@ -171,7 +171,7 @@ if (items.includes(searchValue)) {
171171

172172
```typescript
173173
// O(1) lookup
174-
const items = new Set(["foo", "bar", "baz" /* hundreds more */])
174+
const items = new Set(['foo', 'bar', 'baz' /* hundreds more */])
175175
if (items.has(searchValue)) {
176176
// ...
177177
}
@@ -194,7 +194,7 @@ if (items.has(searchValue)) {
194194
// Intending to check if subset limit is more restrictive than superset
195195
function isLimitSubset(
196196
subset: number | undefined,
197-
superset: number | undefined
197+
superset: number | undefined,
198198
) {
199199
return subset === undefined || superset === undefined || subset <= superset
200200
}
@@ -207,7 +207,7 @@ function isLimitSubset(
207207
```typescript
208208
function isLimitSubset(
209209
subset: number | undefined,
210-
superset: number | undefined
210+
superset: number | undefined,
211211
) {
212212
// Subset with no limit cannot be a subset of one with a limit
213213
return superset === undefined || (subset !== undefined && subset <= superset)
@@ -361,7 +361,7 @@ const dependentBuilders = [] // Accurately describes dependents
361361
```typescript
362362
// Found a bug with fetchSnapshot resolving after up-to-date message
363363
// Should add a test:
364-
test("ignores snapshot that resolves after up-to-date message", async () => {
364+
test('ignores snapshot that resolves after up-to-date message', async () => {
365365
// Reproduce the corner case
366366
// Verify it's handled correctly
367367
})
@@ -520,7 +520,7 @@ const filtered = items.filter((item) => item.value > 0)
520520

521521
```typescript
522522
// ❌ Bad: numeric 1 and string "__number__1" collide
523-
const key = typeof val === "number" ? `__number__${val}` : String(val)
523+
const key = typeof val === 'number' ? `__number__${val}` : String(val)
524524

525525
// ✅ Good: proper encoding with type prefix
526526
const key = `${typeof val}_${String(val)}`

eslint.config.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import prettierPlugin from "eslint-plugin-prettier"
2-
import prettierConfig from "eslint-config-prettier"
3-
import stylisticPlugin from "@stylistic/eslint-plugin"
4-
import { tanstackConfig } from "@tanstack/config/eslint"
1+
import { tanstackConfig } from '@tanstack/config/eslint'
52

63
export default [
74
...tanstackConfig,
@@ -15,39 +12,32 @@ export default [
1512
],
1613
},
1714
{
18-
plugins: {
19-
stylistic: stylisticPlugin,
20-
prettier: prettierPlugin,
21-
},
2215
settings: {
2316
// import-x/* settings required for import/no-cycle.
24-
"import-x/resolver": { typescript: true },
25-
"import-x/extensions": [".ts", ".tsx", ".js", ".jsx", ".cjs", ".mjs"],
17+
'import-x/resolver': { typescript: true },
18+
'import-x/extensions': ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs'],
2619
},
2720
rules: {
28-
"prettier/prettier": `error`,
29-
"stylistic/quotes": [`error`, `backtick`],
30-
"pnpm/enforce-catalog": `off`,
31-
"pnpm/json-enforce-catalog": `off`,
32-
...prettierConfig.rules,
21+
'pnpm/enforce-catalog': `off`,
22+
'pnpm/json-enforce-catalog': `off`,
3323
},
3424
},
3525
{
3626
files: [`**/*.ts`, `**/*.tsx`],
3727
rules: {
38-
"@typescript-eslint/no-unused-vars": [
28+
'@typescript-eslint/no-unused-vars': [
3929
`error`,
4030
{ argsIgnorePattern: `^_`, varsIgnorePattern: `^_` },
4131
],
42-
"@typescript-eslint/naming-convention": [
32+
'@typescript-eslint/naming-convention': [
4333
`error`,
4434
{
4535
selector: `typeParameter`,
4636
format: [`PascalCase`],
4737
leadingUnderscore: `allow`,
4838
},
4939
],
50-
"import/no-cycle": `error`,
40+
'import/no-cycle': `error`,
5141
},
5242
},
5343
]

0 commit comments

Comments
 (0)