Skip to content

Commit

Permalink
🏗 ⬆️ upgrade tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Sep 3, 2024
1 parent 10ea219 commit ddb9555
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/useStorageState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import memoryStorage from "./memoryStorage";
import memoryStorage from "./memoryStorage.js";
import type { Dispatch, SetStateAction } from "react";
import {
useCallback,
Expand Down
23 changes: 6 additions & 17 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
{
"compilerOptions": {
"jsx": "react",
"target": "ES2022",
"module": "ES2022",

"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,

// From what I understand while reading the docs "classic" was introduced first and "classic" is by
// default(except when "module": "commonjs") because of backwards compatibility.
//
// From the docs: "node module resolution is the most-commonly used in the TypeScript community and is
// recommended for most projects."
"moduleResolution": "node",

// the npm package include ".js" files only so we need ".d.ts" files to be generated
"declaration": true,

// - ℹ️ https://www.typescriptlang.org/tsconfig#isolatedModules
// - 😃 Deno requires "isolatedModules" to be set to `true`
// - 😃 the stricter version - I always prefer the stricter version
// - 😃 probably the future
"isolatedModules": true,
// No accidental global scripts
"moduleDetection": "force",
// Enforced 'type-only' imports
"verbatimModuleSyntax": true,

// strict options ensuring more stable code
"strict": true,
Expand Down

0 comments on commit ddb9555

Please sign in to comment.