Skip to content

Commit 21fe22d

Browse files
committed
config(typescript): configure strict settings and import extensions ⚙️
- Add strict TypeScript compiler options to deno.json - Enable allowImportingTsExtensions in tsconfig.json - Update import paths with .ts extensions
1 parent 11c93fd commit 21fe22d

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

deno.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@
99
"@root/": "./src/",
1010
"@interfaces/": "./src/interfaces/"
1111
},
12+
"compilerOptions": {
13+
"allowUnreachableCode": false,
14+
"allowUnusedLabels": false,
15+
"checkJs": false,
16+
"exactOptionalPropertyTypes": true,
17+
"jsx": "react",
18+
"lib": ["deno.ns", "deno.window"],
19+
"noErrorTruncation": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"noImplicitAny": true,
22+
"noImplicitOverride": true,
23+
"noImplicitReturns": true,
24+
"noImplicitThis": true,
25+
"noPropertyAccessFromIndexSignature": true,
26+
"noUncheckedIndexedAccess": true,
27+
"noUnusedLocals": true,
28+
"noUnusedParameters": true,
29+
"strict": true,
30+
"strictBindCallApply": true,
31+
"strictFunctionTypes": true,
32+
"strictNullChecks": true,
33+
"strictPropertyInitialization": true,
34+
"useUnknownInCatchVariables": true
35+
},
1236
"publish": {
1337
"exclude": ["dist/", "node_modules/", "package*.json", "tsconfig.json", "eslint.config.js", "build.config.ts", ".github/", ".prettierignore", ".prettierrc"]
1438
}

src/Constant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { QueryOperatorsType } from '@interfaces/index'
1+
import type { QueryOperatorsType } from '@interfaces/index.ts'
22

33
/**
44
* Query operator constants.

src/Query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { JsonaryCondition, JsonaryParent } from '@interfaces/index'
2-
import { queryOperators, getOperatorsSorted } from '@root/Constant'
1+
import type { JsonaryCondition, JsonaryParent } from '@interfaces/index.ts'
2+
import { queryOperators, getOperatorsSorted } from '@root/Constant.ts'
33

44
/**
55
* Query builder for filtering and manipulating JSON data.

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { JsonaryCondition, JsonaryOptions } from '@interfaces/index'
2-
import { QueryBuilder } from '@root/Query'
1+
import type { JsonaryCondition, JsonaryOptions } from '@interfaces/index.ts'
2+
import { QueryBuilder } from '@root/Query.ts'
33
import { readFileSync, writeFileSync, existsSync } from 'node:fs'
44
import { resolve } from 'node:path'
55

@@ -216,4 +216,4 @@ export default class Jsonary {
216216
* Exports interfaces for type checking.
217217
* @description Provides type definitions for Jsonary operations and conditions.
218218
*/
219-
export * from '@interfaces/index'
219+
export * from '@interfaces/index.ts'

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"tsBuildInfoFile": ".tsbuildinfo",
1515
"importsNotUsedAsValues": "remove",
16+
"allowImportingTsExtensions": true,
1617
"allowSyntheticDefaultImports": true,
1718
"allowUnreachableCode": false,
1819
"allowUnusedLabels": false,

0 commit comments

Comments
 (0)