Skip to content

Commit 86f1cc3

Browse files
committed
chore: need to turn on checkJs to avoid false negatives
1 parent e3fb7fe commit 86f1cc3

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export default [
7777
// [!DISCOURAGED]
7878
// Set to `true` to allow plain `<script>` or `<script setup>` blocks.
7979
// This might result-in false positive or negatives in some rules for `.vue` files.
80-
// Note you also need to configure `allowJs: true` in corresponding `tsconfig.json` files.
80+
// Note you also need to configure `allowJs: true` and `checkJs: true`
81+
// in corresponding `tsconfig.json` files.
8182
js: false,
8283

8384
// [!STRONGLY DISCOURAGED]

examples/allow-js/src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup>
22
import HelloWorld from './components/HelloWorld.vue'
33
import TheWelcome from './components/TheWelcome.vue'
4+
45
</script>
56

67
<template>

examples/allow-js/tsconfig.app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@/*": ["./src/*"]
1212
},
1313

14-
"allowJs": true
14+
"allowJs": true,
15+
"checkJs": true
1516
}
1617
}

examples/minimal/src/main.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@ import { createApp } from 'vue'
44
import App from './App.vue'
55

66
createApp(App).mount('#app')
7-
8-
let a: number = 1
9-
a = 'a'
10-
console.log('a', a)

examples/with-jsx-in-vue/tsconfig.app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@/*": ["./src/*"]
1212
},
1313

14-
"allowJs": true
14+
"allowJs": true,
15+
"checkJs": true
1516
}
1617
}

examples/with-jsx/tsconfig.app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"paths": {
1111
"@/*": ["./src/*"]
1212
},
13-
"allowJs": true
13+
"allowJs": true,
14+
"checkJs": true
1415
}
1516
}

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
// Allow JS files to be imported from TS and vice versa
1616
"allowJs": true,
17+
"checkJs": true,
1718

1819
// Use correct ESM import behavior
1920
"esModuleInterop": true,

0 commit comments

Comments
 (0)