Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable validation of specific typescript files #66017

Closed
msqaddura opened this issue Jan 4, 2019 · 6 comments
Closed

Disable validation of specific typescript files #66017

msqaddura opened this issue Jan 4, 2019 · 6 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code typescript Typescript support issues

Comments

@msqaddura
Copy link

msqaddura commented Jan 4, 2019

Issue Type: Bug

Tested on this repo:
https://github.com/itslenny/scaffs
These files:
https://github.com/itslenny/scaffs/tree/master/test/data/scaffolds/Example

Knowing that:

  1. the scaffold files have to be *.ts so changing file extension wont help

Expected Result:
after putting in settings.json "files.watcherExclude" to exclude this folder and also in tsconfig.json "exclude" the folder, VSCode's Problem Viewer should not show [ts] errors.

Real Result:
VSCode shows that these files are erronous

settings.json (please note, i tried so many variances until landed ignore whole folder)
image

tsconfig.json (as well added the whole folder)
image

errors (though VSCode should not look into them)
image

VS Code version: Code 1.30.0 (c6e592b, 2018-12-11T22:21:33.585Z)
OS version: Linux x64 4.18.0-13-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz (8 x 976)
GPU Status 2d_canvas: unavailable_software
checker_imaging: disabled_off
flash_3d: unavailable_software
flash_stage3d: unavailable_software
flash_stage3d_baseline: unavailable_software
gpu_compositing: unavailable_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled_readback
webgl2: unavailable_off
Load (avg) 1, 1, 1
Memory (System) 5.73GB (0.94GB free)
Process Argv .
Screen Reader no
VM 0%
@vscodebot vscodebot bot added the terminal Integrated terminal issues label Jan 4, 2019
@Tyriar Tyriar assigned mjbvz and unassigned Tyriar Jan 4, 2019
@Tyriar Tyriar removed the terminal Integrated terminal issues label Jan 4, 2019
@Tyriar
Copy link
Member

Tyriar commented Jan 4, 2019

I think this is related to ts, not the watcher

@msqaddura
Copy link
Author

msqaddura commented Jan 5, 2019

yes it does seem so, yet isnt it supposed at least via tsconfig>exclude to understand that this file is not to be validated? and actually linting errors disappeared after i excluded the files in tslint.config.json so there must be a charm somewhere. Otherwise, how could I solve this one problem?

@mjbvz
Copy link
Collaborator

mjbvz commented Jan 7, 2019

Yes, vscode's exclude settings are not related to typescript validation. And the tsconfig exclude setting configures the TypeScript project, it will also not disable validation for TS files you open

A few options:

@ghiscoding
Copy link

  • Disable all TS validation by setting "typescript.validate.enable": false
  • Get TS to support a @no-check flag in files: microsoft/TypeScript#26887

These 2 options work but are there any better option to exclude certain folder? I want to exclude code validation for all my __tests__ (Jest Unit Test) and I could go and add // @ts-nocheck on top of each file but I find that counter productive since I have hundred of unit test files. If "typescript.validate.enable" could exclude certain folders that would be the best option.

@msqaddura have you found a better alternative?

@geekley
Copy link

geekley commented Dec 7, 2020

@mjbvz the 3 suggested solutions don't really help with generated files, which I can't edit
I'd like to hide src-gen/** error squiggles without having to disable tokenization or validation (sometimes I need to dig into the generated code for debugging)
I think vscode should have a way in settings to ignore errors/warnings/info squiggles generically (regardless of language) while keeping the tokenization. We should be able to hide all squiggles by path pattern and also by error codes.
Do you guys know of some feature request for this that I can upvote?

@EliasTouil
Copy link

I'm having the same issue with generated files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

7 participants
@ghiscoding @Tyriar @EliasTouil @msqaddura @mjbvz @geekley and others