Skip to content

Commit

Permalink
chore: need to turn on checkJs to avoid false negatives
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 24, 2024
1 parent e3fb7fe commit 86f1cc3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export default [
// [!DISCOURAGED]
// Set to `true` to allow plain `<script>` or `<script setup>` blocks.
// This might result-in false positive or negatives in some rules for `.vue` files.
// Note you also need to configure `allowJs: true` in corresponding `tsconfig.json` files.
// Note you also need to configure `allowJs: true` and `checkJs: true`
// in corresponding `tsconfig.json` files.
js: false,

// [!STRONGLY DISCOURAGED]
Expand Down
1 change: 1 addition & 0 deletions examples/allow-js/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
</script>

<template>
Expand Down
3 changes: 2 additions & 1 deletion examples/allow-js/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@/*": ["./src/*"]
},

"allowJs": true
"allowJs": true,
"checkJs": true
}
}
4 changes: 0 additions & 4 deletions examples/minimal/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')

let a: number = 1
a = 'a'
console.log('a', a)
3 changes: 2 additions & 1 deletion examples/with-jsx-in-vue/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@/*": ["./src/*"]
},

"allowJs": true
"allowJs": true,
"checkJs": true
}
}
3 changes: 2 additions & 1 deletion examples/with-jsx/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"paths": {
"@/*": ["./src/*"]
},
"allowJs": true
"allowJs": true,
"checkJs": true
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

// Allow JS files to be imported from TS and vice versa
"allowJs": true,
"checkJs": true,

// Use correct ESM import behavior
"esModuleInterop": true,
Expand Down

0 comments on commit 86f1cc3

Please sign in to comment.