Closed
Description
Hi!
Since we've added the project: './tsconfig.json'
option to parserOptions
(to allow @typescript-eslint/prefer-nullish-coalescing rule for instance) the parsing is really really slow. On our project it went from 30s to 11min.
If we exclude .vue
files or remove the project
option then it's fast again.
Anyone else went into this issue?
Indeed I ran into typescript-eslint/typescript-eslint#389 but the performance on our project when excluding .vue
files is ok, so it's really the parsing of <script> SFCs imho.
Our eslint parsing options:
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
parser: '@typescript-eslint/parser',
project: './tsconfig.json',
extraFileExtensions: ['.vue'],
}
Metadata
Metadata
Assignees
Labels
No labels
Activity
lukaVarga commentedon Feb 26, 2020
Yep, I also noticed a significant slowdown after adding tsconfig (although perhaps not as drastic)
rndmerle commentedon Jun 15, 2020
If anyone interested, we're now using Eslint nested overrides so
vue-eslint-parser
runs only on.vue
files. It speeds things up a bit (down to 4-5' from 11').ota-meshi commentedon Dec 3, 2020
It doesn't slow down in my development environment. Is it possible to find out the problems of the program in your environment?
rndmerle commentedon Dec 11, 2020
I don't know much what to test in order to help.
I ran eslint only on .vue files with TIMING env but it doesn't help much :
Currently, it runs in almost 5 minutes, on a 2019 MacBook Pro, on 539 .vue files.
ota-meshi commentedon Dec 12, 2020
If you can't find the cause, your problem may not be resolved.
Could you share your repository that reproduces the problem and wait for someone to find a solution?
rndmerle commentedon Dec 12, 2020
It's the private repository of our company's product so I can't share it :(
I understand that without further details you can't do much.
If other ppl don't have this issue feel free to close the issue.
Because we don't lint on git hook or anything real-time we can live with 4-5mins linting once in a while.
yoyo930021 commentedon Mar 5, 2021
The reason is in #104.
MayaRainer commentedon Mar 9, 2021
I'm fairly certain this is due to the issue #62 aims to fix. I run a fork with that PR applied and it completely fixed my performance issues.
Without it, typescript-eslint has to parse the entire project for every Vue expression, which really adds up.
yoyo930021 commentedon Mar 9, 2021
If i am not mistaken,
Template expression allow TypeScript type in vue 3?
MayaRainer commentedon Mar 9, 2021
Not as far as I have seen. I looked it up and didn't find any mention of that, either. I think you would need to use TSX for that.
yoyo930021 commentedon Aug 24, 2021
Try this #104 (comment)
rndmerle commentedon Sep 2, 2021
Working great ! Down from 4-5' to 15"
Thanks.
I've to mention that we had to keep our config with "overrides". When I tried to merge everything under 'vue-eslint-parser' it would complain about missing project parameter (even tho it was defined and all .vue files had a <script lang="ts"> tag)
yusuf-khamis commentedon Aug 13, 2022
Is anyone else experiencing this issue even after trying out the overrides, in my case am using nuxt with typescript and airbnb eslint extension, one vue file takes more than 2 minutes but if i just lint typescript files, it takes about 5 seconds, here is my config:
Help would be appreciated here, a whole project lint takes more than 20 minutes, which is absurd, and surprising thing, its the first am encountering even though I sometimes copy paste the config between different projects
ENV:
node v16.15.1 (npm v8.11.0)
project: undefined
when parsing script-fragments in<template>
. #1954 remaining items