Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 30, 2024
1 parent 4c6037b commit 2ab1c51
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@
"generics"
],
"devDependencies": {
"@sindresorhus/tsconfig": "~0.7.0",
"expect-type": "^0.15.0",
"npm-run-all2": "^6.1.2",
"tsd": "^0.28.1",
"typescript": "^5.2.2",
"tsd": "^0.29.0",
"typescript": "~5.4.3",
"xo": "^0.58.0"
},
"xo": {
Expand Down
1 change: 0 additions & 1 deletion test-d/except.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ type Example = {

const test: Except<Example, 'bar', {requireExactProps: false}> = {foo: 123, bar: 'asdf'};
expectType<number>(test.foo);
// eslint-disable-next-line @typescript-eslint/dot-notation
expectType<unknown>(test['bar']);
2 changes: 1 addition & 1 deletion test-d/merge-deep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ expectType<Array<'life' | 42>>(mergeDeep(['life'] as const, [42] as const, {arra

// Should merge tuples with union
expectType<Array<number | string | boolean>>(mergeDeep(['life', true], [42], {arrayMergeMode: 'spread'}));
expectType<Array<number | string | boolean>>(mergeDeep(['life'], [42, true], {arrayMergeMode: 'spread'}));
expectType<Array<number | string | true>>(mergeDeep(['life'], [42, true], {arrayMergeMode: 'spread'}));

// Should not deep merge classes
class ClassA {
Expand Down
2 changes: 0 additions & 2 deletions test-d/unknown-record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ expectError(foo = []);
expectError(foo = 42);
expectError(foo = null);

expectType<unknown>(foo.bar);
// eslint-disable-next-line @typescript-eslint/dot-notation
expectType<unknown>(foo['bar']);
22 changes: 19 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
{
"extends": "@sindresorhus/tsconfig",
/// "extends": "@sindresorhus/tsconfig",
"compilerOptions": {
"noEmit": true,
"target": "ES2019", // Node.js 12
"target": "ES2021", // Node.js 16
"lib": [
"ES2020",
"ES2021",
"DOM"
],
"exactOptionalPropertyTypes": true,
"skipLibCheck": false, // Ensures .d.ts files are checked: https://github.com/sindresorhus/tsconfig/issues/15

// Compatibility
"module": "commonjs",
"moduleResolution": "node",

// TODO: Use the reusable tsconfig again when targeting ESM.
// From https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json
"strict": true,
"noImplicitReturns": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
// "noUncheckedIndexedAccess": true, // TODO: Enable.
"noPropertyAccessFromIndexSignature": true,
"useDefineForClassFields": true,
},
"exclude": [
"test-d/**/*"
Expand Down

0 comments on commit 2ab1c51

Please sign in to comment.