Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Typed TSLint rules can fail on .vue snippets  #2916

Copy link
Copy link
Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg
Issue body actions

Version

3.1.1

Reproduction link

https://github.com/millimoose/vue-tslint-microsoft-contrib-bug

Node and OS info

Node 9.7.1 / npm 6.4.1

Steps to reproduce

  1. Clone and npm install in that repro
  2. npm run lint --no-fix

What is expected?

Typed TSLint rules should only be run on files that have a corresponding entry in the backing TypeScript program. Some operations run on nodes in the files by TSLint rules query the program for type information only available on those files.

What is actually happening?

The Vue CLI is patching the program's getSourceFile to return a manually created file from ts.createSourceFile for Vue files (per isVueFile).

const patchProgram = program => {

Untyped rules will work fine with this, but some typed rules will throw. For example, no-unsafe-any crashes: palantir/tslint#4273


Related TypeScript issue: microsoft/TypeScript#8136

This is a more general case of #2712 as originally reported by @millimoose. The bug investigation trail went from there to TSLint to TypeScript and back to here, amusingly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.