Skip to content

Parser reports "Parsing error" for new files added to project (VSCode) #864

Closed
eggjs/egg-tslint-to-eslint
#3
@ArcanoxDragon

Description

@ArcanoxDragon

What code were you trying to parse?

A new React component module. This happens on all new TypeScript source files, however. This is being triggered from the instance of ESLint that VSCode runs in the background, meaning that in order to get this error to go away, I have to reload the entire VSCode window.

import React from "react";

import { EditorProps } from ".";
import { Switch } from "@material-ui/core";

export function AreaListMode( { settings, updateSettings }: EditorProps ) {
    return <Switch checked={ settings.areaListStyle } onChange={ e => updateSettings( { areaListStyle: e.target.checked ? "compact" : "default" } ) } />;
}

tsconfig.json include:

"include": [
	"projects/*/typings/**/*",
	"projects/*/src/**/*"
],

What did you expect to happen?
The file should be parsed normally, as its path is matched by the include property in my tsconfig.json file.

What actually happened?
A "Parsing error" is reported on the first line of any file that is created while the VSCode linter instance is running, saying that the file is not included in the project. The error does not go away unless I restart VSCode (or reload the window).

image

Versions

package version
@typescript-eslint/parser 2.0.0
TypeScript 3.4.5
ESLint 6.1.0
node 12.7.0
npm yarn 1.17.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thislocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: parserIssues related to @typescript-eslint/parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions