Skip to content

Commit cd8cd02

Browse files
chore: enable tsdown devExports, move eslint to tsdown (#325)
* chore: enable tsdown devExports * Move eslint to tsdown * Add changeset
1 parent 4413fde commit cd8cd02

32 files changed

+322
-236
lines changed

.changeset/cute-pandas-ask.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/vite-config': patch
3+
---
4+
5+
chore: use publishConfig exports

.changeset/quick-hounds-train.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/eslint-config': patch
3+
---
4+
5+
chore(eslint): move to tsdown

nx.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"nxCloudId": "65cc80a2ddc7c22ebb07831c",
55
"useInferencePlugins": false,
66
"parallel": 5,
7+
"tui": {
8+
"enabled": false
9+
},
710
"targetDefaults": {
811
"test:docs": {
912
"cache": true,
@@ -14,20 +17,16 @@
1417
"inputs": ["{workspaceRoot}/**/package.json"]
1518
},
1619
"test:eslint": {
17-
"cache": true,
18-
"dependsOn": ["^build"]
20+
"cache": true
1921
},
2022
"test:types": {
21-
"cache": true,
22-
"dependsOn": ["^build"]
23+
"cache": true
2324
},
2425
"build": {
25-
"cache": true,
26-
"dependsOn": ["^build"]
26+
"cache": true
2727
},
2828
"test:build": {
29-
"cache": true,
30-
"dependsOn": ["build"]
29+
"cache": true
3130
}
3231
}
3332
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@svitejs/changesets-changelog-github-compact": "catalog:",
4141
"@types/node": "catalog:",
4242
"eslint": "catalog:",
43+
"jiti": "catalog:",
4344
"jsdom": "catalog:",
4445
"markdown-link-extractor": "catalog:",
4546
"nx": "catalog:",

packages/eslint-config/eslint.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @ts-check
2+
3+
import { tanstackConfig } from '@tanstack/eslint-config'
4+
5+
export default [...tanstackConfig]

packages/eslint-config/package.json

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,26 @@
1717
"scripts": {
1818
"test:types": "tsc",
1919
"test:eslint": "eslint --concurrency=auto ./src",
20-
"test:build": "publint --strict"
20+
"build": "tsdown"
2121
},
2222
"type": "module",
23+
"main": "./dist/index.js",
24+
"module": "./dist/index.js",
25+
"types": "./dist/index.d.ts",
2326
"exports": {
24-
".": {
25-
"import": {
26-
"types": "./src/index.d.ts",
27-
"default": "./src/index.js"
28-
}
29-
},
27+
".": "./src/index.ts",
3028
"./package.json": "./package.json"
3129
},
30+
"publishConfig": {
31+
"exports": {
32+
".": "./dist/index.js",
33+
"./package.json": "./package.json"
34+
}
35+
},
3236
"preferGlobal": false,
3337
"sideEffects": false,
3438
"files": [
39+
"dist",
3540
"src"
3641
],
3742
"engines": {
@@ -48,6 +53,10 @@
4853
},
4954
"devDependencies": {
5055
"@types/eslint": "catalog:",
51-
"eslint": "catalog:"
56+
"eslint": "catalog:",
57+
"tsdown": "catalog:"
58+
},
59+
"peerDependencies": {
60+
"eslint": "^8.0.0 || ^9.0.0"
5261
}
5362
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
// https://github.com/un-ts/eslint-plugin-import-x
1+
import type { Linter } from 'eslint'
22

3-
/** @type {import('eslint').Linter.RulesRecord} */
4-
export const importRules = {
3+
/**
4+
* @see https://github.com/un-ts/eslint-plugin-import-x
5+
*/
6+
export const importRules: Linter.RulesRecord = {
57
/** Bans the use of inline type-only markers for named imports */
68
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
79
/** Reports any imports that come after non-import statements */

packages/eslint-config/src/index.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { importRules } from './import.js'
99
import { typescriptRules } from './typescript.js'
1010
import { nodeRules } from './node.js'
1111
import { stylisticRules } from './stylistic.js'
12+
import type { Linter } from 'eslint'
1213

1314
const GLOB_EXCLUDE = [
1415
'**/.nx/**',
@@ -35,8 +36,7 @@ const jsPlugins = {
3536
node: nodePlugin,
3637
}
3738

38-
/** @type {Array<import('eslint').Linter.Config>} */
39-
export const tanstackConfig = [
39+
export const tanstackConfig: Array<Linter.Config> = [
4040
{
4141
name: 'tanstack/ignores',
4242
ignores: GLOB_EXCLUDE,

0 commit comments

Comments
 (0)