Skip to content

Commit dbbf883

Browse files
committed
Fix what copilot couldn't
1 parent 4d8dadc commit dbbf883

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

add-examples-to-dts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
import {readFileSync, writeFileSync} from 'node:fs';
33
import {execSync} from 'node:child_process';
44
// Import index.ts to populate the test data via side effect
5-
// eslint-disable-next-line import-x/no-unassigned-import, n/file-extension-in-import
5+
// eslint-disable-next-line import-x/no-unassigned-import
66
import './index.ts';
7-
// eslint-disable-next-line n/file-extension-in-import
87
import {getTests} from './collector.ts';
98

109
// Read the generated .d.ts file

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import reservedNames from 'github-reserved-names/reserved-names.json' with {type: 'json'};
2-
import {addTests} from './collector.js';
2+
import {addTests} from './collector.ts';
33

44
const $ = <E extends Element>(selector: string) => document.querySelector<E>(selector);
55
const exists = (selector: string) => Boolean($(selector));

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"scripts": {
2727
"build": "run-p build:*",
2828
"build:esbuild": "esbuild index.ts --bundle --external:github-reserved-names --outdir=distribution --format=esm --drop-labels=TEST",
29-
"build:typescript": "tsc --declaration --emitDeclarationOnly",
30-
"postbuild:typescript": "node --experimental-strip-types add-examples-to-dts.ts",
29+
"build:typescript": "tsc",
30+
"postbuild:typescript": "node add-examples-to-dts.ts",
3131
"build:demo": "vite build demo",
3232
"try": "esbuild index.ts --bundle --global-name=x --format=iife | pbcopy && echo 'Copied to clipboard'",
3333
"fix": "xo --fix",

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"extends": "@sindresorhus/tsconfig",
33
"compilerOptions": {
4-
// TODO: Drop after https://github.com/sindresorhus/tsconfig/issues/29
5-
"resolveJsonModule": true,
6-
"moduleResolution": "Node",
7-
"module": "Preserve"
4+
"emitDeclarationOnly": true,
5+
"allowImportingTsExtensions": true
86
},
97
"include": [
108
"index.ts",

0 commit comments

Comments
 (0)