Skip to content

Commit

Permalink
perf: fallback to espree when acceptable, for better performance
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 28, 2024
1 parent 7e6c823 commit 0433498
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,22 @@ export default function createConfig({
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslintParser,
parser: {
// Fallback to espree for js/jsx scripts, as well as SFCs without scripts
// for better performance.
'js': 'espree',
'jsx': 'espree',

'ts': tseslintParser,
'tsx': tseslintParser,

// Leave the template parser unspecified,
// so that it could be determined by `<script lang="...">`
},
ecmaFeatures: {
jsx: mayHaveJsx,
},
extraFileExtensions: ['vue'],
jsx: mayHaveJsx,
// type-aware linting is in conflict with jsx syntax in `.vue` files
projectService: !mayHaveJsx,
},
Expand Down

0 comments on commit 0433498

Please sign in to comment.