Skip to content

Multi-project configuration doesn't type check files not included in any project #724

@ark120202

Description

@ark120202

What code were you trying to parse?

[1].forEach(value => value + 1);

What did you expect to happen?

No warnings

What actually happened?

A warning from @typescript-eslint/restrict-plus-operands rule.

After a bit of debugging I found out that type checker returned any type for the value node. It happened because project didn't contain a reference to package's tsconfig file, so this file was linted in a context of an inferred project.

I've tried to reproduce it in an isolated environment and looks like it works correctly if there is only one project.

UPD: After reading source it makes sense that it can't do the same thing it does with a single config, but falling back to the same program used for non-type-checked rules should also make rules handle it like it does without any project specified - throw an error.

Versions

package version
@typescript-eslint/typescript-estree 1.12.0
TypeScript 3.5.3
node 12.1.0
npm 6.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thispackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy