We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
rootDir
1 parent ffbd03b commit 0d2e74aCopy full SHA for 0d2e74a
src/index.ts
@@ -6,6 +6,7 @@ import vueParser from 'vue-eslint-parser'
6
import pluginVue from 'eslint-plugin-vue'
7
8
import fg from 'fast-glob'
9
+import path from 'node:path'
10
11
type ExtendableConfigName = keyof typeof tseslint.configs
12
type ScriptLang = 'ts' | 'tsx' | 'js' | 'jsx'
@@ -33,7 +34,8 @@ export default function createConfig({
33
34
})
35
.reduce(
36
(acc, file) => {
- const contents = fs.readFileSync(file, 'utf8')
37
+ const absolutePath = path.resolve(rootDir, file)
38
+ const contents = fs.readFileSync(absolutePath, 'utf8')
39
// contents matches the <script lang="ts"> (there can be anything but `>` between `script` and `lang`)
40
if (/<script[^>]*\blang\s*=\s*"ts"[^>]*>/i.test(contents)) {
41
acc.vueFilesWithScriptTs.push(file)
0 commit comments