Skip to content

MatthiasKunnen/eslint-vue-ts-keyword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unrelated Vue file causes an infinite loop while linting another Vue file

Linting src/limited.vue hangs due to src/hang-cause.vue. Test this using yarn run lint:hang.

The strange thing however, is that linting src/hang-cause.vue does not hang. Test this using yarn run lint:cause.

My thoughts
I believe the problem is that typescript-estree:createWatchProgram parses all files that are mentioned in the tsconfig's include property which makes it attempt to parse the tags which causes the infinite loop. This despite the parser being set to <template>: espree. Now the question is if this can be avoided.

Failing code

The problem occurs in very specific circumstances. Examples of code that causes the issue:

<template>
    <div style="display: none"
         static
         class=""
    >
    </div>
</template>
<template>
  <div data-test="
        static
        class">
  </div>
</template>

Succeeding code

The following examples do not cause infinite loops.

<template>
  <div style="display: none"
       static class="">
  </div>
</template>
<template>
  <div
      static
      class="">
  </div>
</template>
<template>
  <div
      static
  >
  </div>
</template>

Error

Eslint eventually fails with FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory. See error.log.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published