In VSCode, the "NPM SCRIPTS" panel shows the root package.json scripts as expected and desired, however it also shows scripts from a package.json in a hidden .cache folder.
Other SO answers advise editing VSCode's settings.json to control this area, using:
`"npm.exclude": "**/#(|vendor|node_modules|bower_components|dist|static)/**",`
However adding |.cache to this exclude line does nothing; the .cache package.json scripts are still displayed.
Put another way, how can I just see the root package.json NPM scripts in VSCode's "NPM SCRIPTS" panel?
Related
I work on various projects located in different directories. So I can't be specific to CWD settings in
VSCode using
"terminal.integrated.cwd": ""
Whenever I open a folder in VSCode with remote-wsl I want my terminal to be also open at the same location as of folder. I have trouble figuring it how to achieve this actually or have I missed something in VSCode settings.
I have a problem that has been bugging me for months. I have a software directory structure which when viewed in visual studio code explorer is missing a directory called 'install' all other directories are visible. If I delete the 'install' directory and recreate it with visual studio code explorer (right click and select new folder) it does not appear in the explorer but does appear in the file system.
Somehow visual studio explorer seems to be filtering out any directory call 'install' anywhere in the directory structure or on any other filesystem.
The same thing happens if I try and create an 'install' directory on any filesystem, local filesystem, local git repo, remote folder, etc.
Any suggestions about how this is happening and what to do about it?
make sure you don't have by accident a setting like this in your settings.json file:
"files.exclude": {
"install": true
},
If you use the gui for your settings instead of the json file, search for "Files: Exclude" and you will see the files or folders that are told not to display.
I am using the ESLint plugin by Dirk Baeumer in Visual Studio Code.
My project is large and complex and divided into several primary directories. Each directory has its own package.json file, its own node_modules directory and its own version of eslint. This is causing havoc after upgrading to ESLint 6 because my ESLint plugins won't resolve.
How do I configure the ESLint plugin to respect the eslint version used in each directory? I think it has something to do with the eslint.workingDirectories setting, but I don't understand how to use it properly.
Further information:
My project workspace has two root directories, "folder1" and "folder2". The directory structure looks something like this:
folder1
.eslintrc.json -- rules for the entire "folder1" project to follow
build
platform
core
Makefile
core-v1
.eslintrc.json
Makefile
package.json -- eslint v4
node_modules
core-v2
.eslintrc.json
Makefile
package.json -- eslint v6
node_modules
folder2
My workspace configuration file includes:
"eslint.workingDirectories": [
"./folder1/core/core-v1",
"./folder1/core/core-v2"
]
This seems to produce the following error, and no linting errors are detected or highlighted:
Uncaught exception received.
Error: spawn /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Renderer).app/Contents/MacOS/Code - Insiders Helper (Renderer) ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
How do I configure the ESLint plugin to use eslint v4 for files in "folder1/core/core-v1" and v6 for files in "folder1/core/core-v2"? My build process runs separate scripts for these directories, but my editor (VS Code) is trying to use a either v4 or v6 to lint all of the files in my project.
First off, the working directories cannot include root folder names:
"eslint.workingDirectories": [
"./core/core-v1",
"./core/core-v2"
]
This seems to correctly identify the working directories and allows version 6 of ESLint to correctly resolve plugins, etc. It also applies v6 rules to core-v2 but still seems to be using the v4 rules for core-v1, so I think this is correct.
One issue that is still not resolve completely is how this works with multi-root workspaces. This works fine for folder1. folder2 just seems to be working, though I can't explain why since it's not identified as a working directory. Thankfully there are no conflicting paths, but what would I do if there were? That may be worth a separate question, but I seem to be up and running now.
I have an angular project open in VSCode, but whenever I activate certain file tabs it hides every file & folder inside my src/ directory!
Here's a screen recording of what happens: https://imgur.com/kQrIUdQ
No other folders are affected, and nothing is actually chnaged in the src/ folder. I can seect a *.ts file, close VSCode, and then re-open it with that *.ts file active and the folder contents shows again until I activate a tab that does this again.
This is extremely annoying and I've never seen this happen before. let me know if you need any other information to help diagnose this issue.
Edit: My installed extensions are as follows:
Angular Language Service 0.1.11
AutoHotkey 0.2.2
C# 1.18.0
Code Spell Checker v1.6.10
Hosts Language v1.1.1
npm v0.3.5
npm Intellisense v1.3.0
Prettify JSON v0.0.3
stylelint v0.48.0
TSLint v1.0.0
I fork this repo https://github.com/Esri/ago-assistant and cloned to my machine and "npm install" to get the dependencies.
But when I try to open the index.html in the console I get errors about files "missing". I say "missing" because the files are there but they don't have the ".min.js" file extension just ".js".
How do I fix this other than going to all the files manually changing the extension? Or what's a better apporach or best practice here? Thanks
The best way to handle this would be to minify the files yourself using the process the project recommends. According to the package.json of the project, they're using Babel in combination with uglify-js.
You should be able to resolve this by simply running build:js from the project folder, which will launch the build script for the project, including the minifcation component: uglifyjs -c -o build/js/main.min.js.
As an alternative, you should also be able to run the relevant task from Visual Studio's Task Runner Explorer (View --> Other Windows --> Task Runner Explorer). If the task does not show up, installing the NPM Task Manager Runner should force it to.