Skip to content

Commit 2daaa3e

Browse files
committed
fix(typescript): rework tsconfig project setup
1 parent 0022c3f commit 2daaa3e

File tree

10 files changed

+39
-34
lines changed

10 files changed

+39
-34
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
ref: ${{ inputs.commit-hash || 'main' }}
3535
fetch-depth: 0
3636

37-
- name: 🚧 Build
38-
uses: ./.github/actions/build
37+
- name: 🧱 Install
38+
uses: ./.github/actions/install
3939

4040
- name: ☁️ Publish
4141
env:

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,3 @@ Thumbs.db
125125
# Vite
126126
vite.config.js.timestamp-*
127127
vite.config.ts.timestamp-*
128-
129-
# GitHub
130-
.github/copilot-instructions.md

eslint.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
import { defineSvelteConfig } from '@dvcol/eslint-config';
22

3-
export default defineSvelteConfig();
3+
export default defineSvelteConfig({
4+
ignores: [
5+
'.github/copilot-instructions.md',
6+
'README.md',
7+
],
8+
});

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,19 @@
167167
"vite:watch": "vite build --watch",
168168
"vite:preview": "vite preview --host",
169169
"dev": "run-s vite:serve",
170-
"build": "run-s vite:build package",
170+
"build": "run-s check package",
171171
"build:web": "VITE_MODE=WEB run-s vite:build",
172172
"serve:web": "VITE_MODE=WEB run-p vite:watch vite:preview",
173173
"package": "svelte-kit sync && svelte-package && publint",
174-
"prepublishOnly": "npm run package",
175-
"check:type": "tsc -p tsconfig.json",
176-
"check:type:watch": "tsc -p tsconfig.json --watch",
177-
"check:svelte": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
178-
"check:svelte:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
174+
"prepublishOnly": "run-s package",
175+
"check:type": "tsc -p tsconfig.build.json",
176+
"check:type:watch": "tsc -p tsconfig.build.json --watch",
177+
"check:svelte": "svelte-kit sync && svelte-check --tsconfig tsconfig.build.json",
178+
"check:svelte:watch": "svelte-kit sync && svelte-check --tsconfig tsconfig.build.json --watch",
179179
"check": "run-s check:type check:svelte",
180180
"check:watch": "run-p check:type:watch check:svelte:watch",
181-
"lint": "eslint src demo",
182-
"lint:fix": "eslint src demo --fix",
181+
"lint": "eslint .",
182+
"lint:fix": "eslint . --fix",
183183
"style": "stylelint **/*.{svelte,css,scss,less,html} --go '{\"gitignore\":true}'",
184184
"style:fix": "pnpm run style --fix",
185185
"test:unit": "vitest --run --coverage",

src/lib/inputs/NeoPin.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@
9696
9797
const labelId = $derived(label ? `neo-pin-label-${getUUID()}` : undefined);
9898
99-
const refs = $state<NeoInputHTMLElement[][]>(Array.from({ length: Number(groups) }).fill([]));
100-
const values = $state<string[][]>(Array.from({ length: Number(groups) }).fill(Array.from({ length: Number(count) }).fill('')));
101-
const touches = $state<boolean[][]>(Array.from({ length: Number(groups) }).fill(Array.from({ length: Number(count) }).fill(false)));
102-
const dirtiness = $state<boolean[][]>(Array.from({ length: Number(groups) }).fill(Array.from({ length: Number(count) }).fill(false)));
99+
const refs = $state<NeoInputHTMLElement[][]>(Array.from<NeoInputHTMLElement[]>({ length: Number(groups) }).fill([]));
100+
const values = $state<string[][]>(Array.from<string[]>({ length: Number(groups) }).fill(Array.from<string>({ length: Number(count) }).fill('')));
101+
const touches = $state<boolean[][]>(Array.from<boolean[]>({ length: Number(groups) }).fill(Array.from<boolean>({ length: Number(count) }).fill(false)));
102+
const dirtiness = $state<boolean[][]>(Array.from<boolean[]>({ length: Number(groups) }).fill(Array.from<boolean>({ length: Number(count) }).fill(false)));
103103
104104
const initial = $state(value);
105105
let validationMessage: string | undefined = $state(ref?.validationMessage);

tsconfig.build.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
6+
"resolveJsonModule": true,
7+
"allowJs": true,
8+
"checkJs": true,
9+
"strict": true,
10+
"sourceMap": true,
11+
"esModuleInterop": true,
12+
"forceConsistentCasingInFileNames": true,
13+
"skipLibCheck": true
14+
}
15+
}

tsconfig.demo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"extends": "./tsconfig.build.json",
33
"include": ["demo/**/*.ts", "demo/**/*.svelte"]
44
}

tsconfig.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
{
2-
"extends": "./.svelte-kit/tsconfig.json",
3-
"compilerOptions": {
4-
"module": "NodeNext",
5-
"moduleResolution": "NodeNext",
6-
"resolveJsonModule": true,
7-
"allowJs": true,
8-
"checkJs": true,
9-
"strict": true,
10-
"sourceMap": true,
11-
"esModuleInterop": true,
12-
"forceConsistentCasingInFileNames": true,
13-
"skipLibCheck": true
14-
},
2+
"extends": ["./.svelte-kit/tsconfig.json", "./tsconfig.build.json"],
153
"references": [
164
{ "path": "./tsconfig.vite.json" },
175
{ "path": "./tsconfig.demo.json" }

tsconfig.vite.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["@tsconfig/node22/tsconfig.json", "./tsconfig.json"],
2+
"extends": ["@tsconfig/node22/tsconfig.json", "./tsconfig.build.json"],
33
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vite.tsbuildinfo",
44
"compilerOptions": {
55
"composite": true,

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (isDev) {
2222
}),
2323
checker({
2424
typescript: {
25-
tsconfigPath: 'tsconfig.json',
25+
tsconfigPath: 'tsconfig.build.json',
2626
},
2727
}),
2828
);

0 commit comments

Comments
 (0)