diff --git a/.github/workflows/lint-typescript.yml b/.github/workflows/lint-typescript.yml index 5250799c..fc667d57 100644 --- a/.github/workflows/lint-typescript.yml +++ b/.github/workflows/lint-typescript.yml @@ -19,6 +19,8 @@ on: - "**/*.json" - "**/*.lockb" - "**/package.json" + - "**/tsconfig.json" + - "**/eslintrc.js" pull_request: paths: - ".github/workflows/lint-typescript.yml" @@ -30,6 +32,8 @@ on: - "**/*.json" - "**/*.lockb" - "**/package.json" + - "**/tsconfig.json" + - "**/eslintrc.js" jobs: tsc: diff --git a/config/tsconfig.json b/config/tsconfig.json index fcffbe61..2001f260 100644 --- a/config/tsconfig.json +++ b/config/tsconfig.json @@ -23,7 +23,7 @@ "lib": ["ESNext"], "module": "ESNext", "moduleResolution": "Node", - "noEmit": false, + "noEmit": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "noImplicitUseStrict": false, diff --git a/example/src/screens/BenchmarkScreen.tsx b/example/src/screens/BenchmarkScreen.tsx index 2602fbfe..639a8372 100644 --- a/example/src/screens/BenchmarkScreen.tsx +++ b/example/src/screens/BenchmarkScreen.tsx @@ -42,7 +42,7 @@ const benchmarks: Benchmark[] = [ run: (i) => { testDb?.execute( 'INSERT INTO User (id, name, age, networth) VALUES(?, ?, ?, ?)', - [ids[i], stringValue, integerValue, doubleValue], + [ids[i]!, stringValue, integerValue, doubleValue], ) }, }, @@ -55,7 +55,7 @@ const benchmarks: Benchmark[] = [ }, run: (i) => { testDb?.execute('INSERT INTO t1 (a, b, c) VALUES(?, ?, ?)', [ - ids[i], + ids[i]!, integerValue, stringValue, ]) diff --git a/example/tsconfig.json b/example/tsconfig.json index b9d76a7d..6dabcad8 100644 --- a/example/tsconfig.json +++ b/example/tsconfig.json @@ -1,4 +1,10 @@ { "extends": "../config/tsconfig.json", - "include": ["src", "index.js", "../package"] + "include": ["src", "index.js", "../package"], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "react-native-nitro-sqlite": ["../package/src"] + } + } } diff --git a/package/tsconfig.build.json b/package/tsconfig.build.json index cd73fa27..9a3228e0 100644 --- a/package/tsconfig.build.json +++ b/package/tsconfig.build.json @@ -1,7 +1,8 @@ { "extends": "../config/tsconfig.json", - "include": ["src"], + "include": ["src/**/*.ts", "src/**/*.tsx"], "compilerOptions": { - "rootDir": "src" + "rootDir": "src", + "noEmit": false } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..118e7b29 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./package/tsconfig.json" }, + { "path": "./example/tsconfig.json" } + ] +}