Describe the bug
When importing @tauri-apps/api, I get TypeScript errors/warnings/hints from inside node_modules.
I thought this was an issue with svelte-check, but as explained in sveltejs/language-tools#1056 (comment) this happens because .ts files are being imported from node_modules.
This might also be the cause of #2594
Platform and Versions
Details
Operating System - Mac OS, version 10.15.7 X64
Node.js environment
Node.js - 14.16.0
@tauri-apps/cli - 1.0.0-beta.10
@tauri-apps/api - 1.0.0-beta.8
Global packages
npm - 6.14.11
yarn - 1.22.10
Rust environment
rustc - 1.54.0
cargo - 1.54.0
App directory structure
/node_modules
/src-tauri
/build
/.git
/src
App
tauri.rs - 1.0.0-beta.8
build-type - bundle
CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - ../build
devPath - http://localhost:5000
framework - Svelte
Stack Trace
Details
> @ check /Users/kasper/dev/git/kryp
> svelte-check --tsconfig ./tsconfig.json
====================================
Loading svelte-check in workspace: /Users/kasper/dev/git/kryp
Getting Svelte diagnostics...
/Users/kasper/dev/git/kryp/node_modules/@tauri-apps/api/helpers/event.ts:7:1
Error: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
import { WindowLabel } from '../window'
import { invokeTauriCommand } from './tauri'
/Users/kasper/dev/git/kryp/node_modules/@tauri-apps/api/event.ts:15:1
Error: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
import { transformCallback } from './tauri'
import { LiteralUnion } from 'type-fest'
/Users/kasper/dev/git/kryp/node_modules/@tauri-apps/api/helpers/os-check.ts:8:20
Hint: 'appVersion' is deprecated.
function isLinux(): boolean {
return navigator.appVersion.includes('Linux')
}
/Users/kasper/dev/git/kryp/node_modules/@tauri-apps/api/helpers/os-check.ts:12:20
Hint: 'appVersion' is deprecated.
function isWindows(): boolean {
return navigator.appVersion.includes('Win')
}
/Users/kasper/dev/git/kryp/node_modules/@tauri-apps/api/helpers/os-check.ts:16:20
Hint: 'appVersion' is deprecated.
function isMacOS(): boolean {
return navigator.appVersion.includes('Mac')
}
/Users/kasper/dev/git/kryp/src/lib/NumericInput.svelte:36:9
Error: Object is possibly 'null'. (ts)
} else {
start -= 1
end -= 1
/Users/kasper/dev/git/kryp/src/lib/NumericInput.svelte:37:9
Error: Object is possibly 'null'. (ts)
start -= 1
end -= 1
}
====================================
Describe the bug
When importing
@tauri-apps/api, I get TypeScript errors/warnings/hints from insidenode_modules.I thought this was an issue with
svelte-check, but as explained in sveltejs/language-tools#1056 (comment) this happens because.tsfiles are being imported fromnode_modules.This might also be the cause of #2594
Platform and Versions
Details
Stack Trace
Details