You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Sorry it's not that minimal, but the required parts should be easy to find).
What is expected?
The linter should only pick up the files referenced by the typescript project, extended by .vue files in src.
As a result, yarn lint should not end up with any errors, like using tslint for the same purpose does.
What is actually happening?
Running yarn lint will yield an error like this:
vue-cli-service lint --fix && stylelint "src/**/*.{scss,vue}"
ERROR FatalError:
Invalid source file: [...]/tests/e2e/specs/test.ts. Ensure that the files supplied to lint have a .ts, .tsx, .d.ts, .js or .jsx extension.
To get this working, it is required to create a separate typescript project that only covers the tests/e2e folder, due to different target and types requirements. Thus, it is also required to exclude this folder in the root project. However, the linter as configured by @vue/cli-plugin-typescript uses a hard-coded list of file patterns if none provided, and those also cover the tests/unit and tests/e2e folders:
I'm wondering why you're not using program.getSourceFiles() (which correctly takes care of any include or exclude option) and just extend that list with the files yielded by the src/**/*.vue pattern. On a more general level, this hard-coded list causes any include, exclude or files restriction in the tsconfig.json to be ignored.
The text was updated successfully, but these errors were encountered:
DorianGrey
changed the title
[@vue/cli-plugin-typescript#lint]: Uses a hard-coded list
[@vue/cli-plugin-typescript#lint]: Uses a hard-coded list instead of project file list
Nov 7, 2018
Version
3.1.1
Reproduction link
https://github.com/DorianGrey/vue-ts-playground/tree/cypress-ts
Node and OS info
Node 10.13 / yarn 1.12.1 / Manjaro 18
Steps to reproduce
yarn
yarn lint
(Sorry it's not that minimal, but the required parts should be easy to find).
What is expected?
The linter should only pick up the files referenced by the
typescript
project, extended by.vue
files insrc
.As a result,
yarn lint
should not end up with any errors, like usingtslint
for the same purpose does.What is actually happening?
Running
yarn lint
will yield an error like this:On the branch linked above, I've followed the
cypress
doc for addingtypescript
support for the E2E spec files: https://docs.cypress.io/guides/tooling/typescript-support.html(The default setup failed with a similar error as mentioned here: #2903)
For details about the changes made, see: https://github.com/DorianGrey/vue-ts-playground/pull/12/files
To get this working, it is required to create a separate
typescript
project that only covers thetests/e2e
folder, due to differenttarget
andtypes
requirements. Thus, it is also required to exclude this folder in the rootproject
. However, the linter as configured by@vue/cli-plugin-typescript
uses a hard-coded list of file patterns if none provided, and those also cover thetests/unit
andtests/e2e
folders:vue-cli/packages/@vue/cli-plugin-typescript/lib/tslint.js
Lines 107 to 109 in f8a0a63
I'm wondering why you're not using
program.getSourceFiles()
(which correctly takes care of anyinclude
orexclude
option) and just extend that list with the files yielded by thesrc/**/*.vue
pattern. On a more general level, this hard-coded list causes anyinclude
,exclude
orfiles
restriction in thetsconfig.json
to be ignored.The text was updated successfully, but these errors were encountered: