chore(configs): migrate oxlint→eslint presets, refactor tsconfig

- Replace @robonen/oxlint with @robonen/eslint (composable ESLint flat-config
  presets: base, typescript, vue, vitest, imports, node, stylistic).
- Plugins bundled as deps: typescript-eslint, eslint-plugin-vue,
  @vitest/eslint-plugin, eslint-plugin-import-x, eslint-plugin-n,
  eslint-plugin-unicorn, @stylistic/eslint-plugin.
- @robonen/tsconfig: add base/dom/node/vue configs for composite project refs.
This commit is contained in:
2026-06-07 16:28:10 +07:00
parent 1d3efa5028
commit 7693b49253
51 changed files with 988 additions and 916 deletions
+85 -10
View File
@@ -1,6 +1,6 @@
# @robonen/tsconfig
Shared base TypeScript configuration.
Shared TypeScript configurations.
## Install
@@ -8,20 +8,95 @@ Shared base TypeScript configuration.
pnpm install -D @robonen/tsconfig
```
## Presets
| Preset | Extends | Use for |
| --- | --- | --- |
| `tsconfig.base.json` | — | Node / isomorphic libraries (`lib: ESNext`, no DOM) |
| `tsconfig.dom.json` | base | Browser libraries (adds `DOM`, `DOM.Iterable`) |
| `tsconfig.vue.json` | dom | Vue SFC libraries / apps (adds `jsx`, `vueCompilerOptions`) |
| `tsconfig.node.json` | base | Build/test tooling files (`*.config.ts`) — adds `types: ["node"]`, no DOM |
| `tsconfig.json` | base | Default alias for `base` (bare `@robonen/tsconfig` import) |
## Usage
Extend from it in your `tsconfig.json`:
Pick the preset that matches the package and extend it:
```json
```jsonc
// Node / isomorphic library
{ "extends": "@robonen/tsconfig/tsconfig.base.json" }
```
```jsonc
// Browser library
{ "extends": "@robonen/tsconfig/tsconfig.dom.json" }
```
```jsonc
// Vue package, with path aliases
{
"extends": "@robonen/tsconfig/tsconfig.json"
"extends": "@robonen/tsconfig/tsconfig.vue.json",
"compilerOptions": {
"paths": { "@/*": ["./src/*"] }
}
}
```
## What's Included
> Path aliases resolve relative to the `tsconfig.json` location — `baseUrl` is
> intentionally omitted (deprecated, removed in TypeScript 7.0).
- **Target / Module**: ESNext with Bundler resolution
- **Strict mode**: `strict`, `noUncheckedIndexedAccess`
- **Module safety**: `verbatimModuleSyntax`, `isolatedModules`
- **Declarations**: `declaration` enabled
- **Interop**: `esModuleInterop`, `allowJs`, `resolveJsonModule`
## Project references (DOM + Node split)
Most packages contain two environments: browser/library `src` (DOM) and Node
tooling files (`vite.config.ts`, `vitest.config.ts`, `tsdown.config.ts`). They
are split into separate projects wired with references, so `src` never sees Node
globals and config files never see `DOM`:
```jsonc
// tsconfig.json — solution root, tools (tsdown/vitest/editor) target src below
{
"files": [],
"references": [
{ "path": "./tsconfig.src.json" },
{ "path": "./tsconfig.node.json" }
]
}
```
```jsonc
// tsconfig.src.json — the library code
{
"extends": "@robonen/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"composite": true,
"types": [],
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.src.tsbuildinfo"
},
"include": ["src/**/*.ts"]
}
```
```jsonc
// tsconfig.node.json — build/test tooling files
{
"extends": "@robonen/tsconfig/tsconfig.node.json",
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
},
"include": ["*.config.ts"]
}
```
Type-check the whole package (both projects) with `tsc -b` / `vue-tsc -b`.
Point `tsdown` at the src project (`tsconfig: './tsconfig.src.json'`) since the
root has no `compilerOptions`.
## What's included (base)
- **Target / Module**: `ESNext` with `module: Preserve` + `Bundler` resolution
- **Strict mode**: `strict`, `noUncheckedIndexedAccess`, `noImplicitOverride`,
`noImplicitReturns`, `noFallthroughCasesInSwitch`, `noUncheckedSideEffectImports`
- **Module safety**: `verbatimModuleSyntax`, `isolatedModules`, `moduleDetection: force`
- **Type-check only**: `noEmit` (declarations/output are produced by `tsdown`)
- **Interop**: `esModuleInterop`, `resolveJsonModule`
+6 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@robonen/tsconfig",
"version": "0.0.2",
"version": "0.1.0",
"license": "Apache-2.0",
"description": "Base typescript configuration for projects",
"keywords": [
@@ -20,7 +20,11 @@
"node": ">=24.13.1"
},
"files": [
"**tsconfig.json"
"tsconfig.json",
"tsconfig.base.json",
"tsconfig.dom.json",
"tsconfig.node.json",
"tsconfig.vue.json"
],
"publishConfig": {
"access": "public"
+35
View File
@@ -0,0 +1,35 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@robonen base (type-check, no DOM)",
"compilerOptions": {
/* Modules */
"module": "Preserve",
"moduleResolution": "Bundler",
"moduleDetection": "force",
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"isolatedModules": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
/* Language and environment */
"target": "ESNext",
"lib": ["ESNext"],
"useDefineForClassFields": true,
/* Type checking (strict) */
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,
"forceConsistentCasingInFileNames": true,
/* Emit is delegated to the bundler (tsdown); tsc is type-check only */
"noEmit": true,
"skipLibCheck": true
},
"exclude": ["node_modules", "dist", ".output", "coverage"]
}
+8
View File
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@robonen dom (browser libraries)",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"lib": ["ESNext", "DOM", "DOM.Iterable"]
}
}
+3 -34
View File
@@ -1,36 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Base TypeScript Configuration",
"compilerOptions": {
/* Basic Options */
"module": "ESNext",
"noEmit": true,
"lib": ["ESNext"],
"moduleResolution": "Bundler",
"target": "ESNext",
"outDir": "dist",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowImportingTsExtensions": true,
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"removeComments": false,
"verbatimModuleSyntax": true,
"useDefineForClassFields": true,
/* Strict Type-Checking Options */
"strict": true,
"noUncheckedIndexedAccess": true,
/* Library transpiling */
"declaration": true,
// "composite": true,
"sourceMap": false,
"declarationMap": false
},
"exclude": ["node_modules", "dist", ".output", "coverage"]
}
"display": "@robonen base (default)",
"extends": "./tsconfig.base.json"
}
+9
View File
@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@robonen node (build/test tooling files)",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"lib": ["ESNext"],
"types": ["node"]
}
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@robonen vue (Vue SFC libraries / apps)",
"extends": "./tsconfig.dom.json",
"compilerOptions": {
"jsx": "preserve"
},
"vueCompilerOptions": {
"strictTemplates": true,
"fallthroughAttributes": true,
"inferTemplateDollarAttrs": true,
"inferTemplateDollarEl": true,
"inferTemplateDollarRefs": true
}
}