Skip to content

flowtype.flow-for-vscode: Flow LSP validates and type-checks files ignored in the [ignore] section of .flowconfig #9350

@sangafabrice

Description

@sangafabrice

Flow version: 0.295.0
flowtype.flow-for-vscode version: 3.1.1
OS: Windows 10

Expected behavior

Files and directories listed in the [ignore] section of .flowconfig should not be validated or type-checked by Flow, including when using the Flow Language Server via flowtype.flow-for-vscode.

With the current setup for this issue, this is the expected state of build/index.js when it is ignored — i.e. no Flow diagnostics are reported, as shown in the image below (Flow LSP not running):

Image

Actual behavior

Despite being ignored in .flowconfig, build/index.js is still validated and type-checked by the Flow LSP in VS Code.

  1. Project structure
C:\repo
│   .flowconfig
│   package-lock.json
│   package.json
│   
────.vscode
│       settings.json
│       
────build
│       index.js
│       
────demo
│       index.js
│       
────node_modules
    │   ...
  1. .flowconfig

The following files and directories are explicitly ignored:

[ignore]
<PROJECT_ROOT>/\.vscode/
<PROJECT_ROOT>/build/
<PROJECT_ROOT>/node_modules/
<PROJECT_ROOT>/package\-lock\.json$
<PROJECT_ROOT>/package\.json$

[include]

[libs]

[lints]
untyped-type-import=error
internal-type=error
unsafe-object-assign=error
nested-component=error
nested-hook=error
libdef-override=error
deprecated-type-bool=error

[options]

[strict]

  1. Flow CLI behavior (expected)

When running Flow, only non-ignored files are visible:

$ npx flow ls 2> /dev/null
C:\repo\demo\index.js
C:\repo\.flowconfig

This confirms that C:\repo\build\index.js is correctly ignored by Flow itself.

  1. Flow LSP behavior in VS Code (unexpected)

After restarting the Flow client via Ctrl + Shift + P → Flow: Restart client, the file C:\repo\build\index.js is still parsed, validated, and produces Flow errors in VS Code:

Image

  • Link to Try-Flow or Github repo:

repo.zip

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