Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Draft: perf changes with type aware linting #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,6 @@ export default function createConfig({
},
})

if (vueFilesWithScriptTs.length > 0) {
projectServiceConfigs.push({
name: 'vue-typescript/default-project-service-for-vue-files',
files: vueFilesWithScriptTs.map(escapePathForGlob),
languageOptions: {
parser: vueParser,
parserOptions: {
projectService: true,
parser: tseslint.parser,
extraFileExtensions,
},
},
})
}

// Vue's own typing inevitably contains some `any`s, so some of the `no-unsafe-*` rules can't be used.
projectServiceConfigs.push({
name: 'vue-typescript/type-aware-rules-in-conflit-with-vue',
Expand Down Expand Up @@ -171,16 +156,15 @@ export default function createConfig({
parser: vueParser,
parserOptions: {
parser: {
// Fallback to espree for js/jsx scripts, as well as SFCs without scripts
// for better performance.
js: 'espree',
jsx: 'espree',
// Using espree results in "`parseForESLint` from parser `context.languageOptions.parser` is invalid and will just be ignored"
js: tseslint.parser,
jsx: tseslint.parser,

ts: tseslint.parser,
tsx: tseslint.parser,

// Leave the template parser unspecified,
// so that it could be determined by `<script lang="...">`
// This makes a huge difference
'<template>': 'espree'
},
// The internal espree version used by vue-eslint-parser is 9.x, which supports ES2024 at most.
// While the parser may try to load the latest version of espree, it's not guaranteed to work.
Expand All @@ -194,6 +178,8 @@ export default function createConfig({
jsx: mayHaveJsxInSfc,
},
extraFileExtensions,
// Defining the tsconfigs was necessary
project: ['**/tsconfig.json', '**/tsconfig.*.json'],
},
},
rules: {
Expand Down