How do I turn off JSLint in Visual Studio 2017? - visual-studio-2017

I loaded up an older aspnet mvc project in Visual Studio 2017, and I can't build it because thousands of warnings/errors from jslint are telling me that the jQuery package has bad bracket placement, among many other things. Frankly, I don't care about any of the errors from jslint, least of all the jQuery errors.
I can't find any options for jslint in the GUI.
Right-clicking on the project gives no jslint context menu
It doesn't seem to exist in Tools > Options
I tried this solution, of turning off EsLint, but that did nothing.

JSLint.Net is a NuGet package. You can configure it via a JSLintNet.json settings file (at the end of that page it says there's a settings dialog, but I can't find it in either VS 2015 or VS 2017.) Or you can uninstall the package thru the Project > Manage NuGet Packages... menu.

Don't know about VS2015 or 2017, but in 2019 the settings file JSLintNet.json can be created in the project folder and then you can set
"runOnBuild": false,
"cancelBuild": false
Here's my complete file:
{
"ignore": [
"\\www\\js-lib\\*.*"
],
"options": {
"predef": {
"$": true,
"document": true,
"login": true,
"setup": true,
"window": true,
"popup": true
},
"plusplus": true,
"unparam": true,
"white": true
},
"output": "Warning",
"runOnSave": true,
"runOnBuild": false,
"cancelBuild": false
}

Related

CMakePresets.json: Using (env-)variable in Visual Studio Remote Settings vendor map

A few weeks ago, we introduced the introduce the cmakepresets.json to our cpp cross platform project, which we code with Visual Studio. The setup was really straight forward and we are able to build and debug our project without any problems.
There is just one thing which is a little bit annoying. I would like to use a variable to secifiy the directory on the remote system. It's defined over the "sourceDir"-tag of the Visual Studio Remote Settings vendor map of the CMakePresets.json. There the HOME enviroment variable is used and the special visual studio variable $ms{projectDirName} which evaluates to the name of the open folder in Visual Studio.
{
"name": "linux-default",
"displayName": "Linux Debug",
"description": "Sets Ninja generator, compilers, build and install directory, debug build type",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [ "Linux" ]
},
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
}
I tried to define a enviroment variable with the CMakeLists.txt but I think that the variable isn't in the scope of the CMakePresets.json. Are there any other possibilities to variable define the source directory?

Visual Studio 2017 JavaScript Language Service has been disabled

While editing JavaScript source files in Visaul Studio 2017, the following error keeps occuring:
The JavaScript language service has been disabled for the following project(s): ...
Even if I disable the JavaScript language service entirely, the error keeps occuring. Why is this happening and how do I stop this error message from displaying all the time? Can I disable the JavaScript language service entirely?
The solution to the problem was simply to use a tsconfig.json file, even though there were only JavaScript files in my solution.
I've just used the following tsconfig.json file in the root of the project:
{
  "compileOnSave": true,
 "compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "sourceMap": true,
    "target": "es2015",
    "module": "amd",
    "allowJs": false,
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "lib",
    "node_modules"
  ]
}
open 'developer command line tool for visual studio'. run :
devenv.exe /resetuserdata

Setup VSCode for C++ on Windows (MSVC)

I'm a little befuddled that I'm not able to setup Visual Studio Code to do C++ development on Windows using MSVC. All over the web people say how pleased they are with how easy everything is to set up and use, but I don't find any straightforward guides; most of them just skip the setup part and show how nice everything works including code completion/intellisense and debugging support.
I have installed Visual Studio 2015 Community Edition (including the debugging tools etc.), Visual Studio Code and the C++ extension by Microsoft.
What do I need to do next?
Edit:
Intellisense works out of the box these days, that's great. But my auto-generated tasks.json doesn't seem to do the trick for building, here's what it looks like:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"type": "process",
"command": "msbuild",
"args": [
// Ask msbuild to generate full paths for file names.
"/property:GenerateFullPaths=true",
"/t:build"
],
"group": "build",
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "always"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
}
When I run this task it seems to run infinitely and only outputs to the following:
Executing task: msbuild /property:GenerateFullPaths=true /t:build <
Any ideas?
For MSVC 2017 version:
add these to your include path:
"D:/Program Files/Microsoft/MSVC2017/VC/Tools/MSVC/14.12.25827/include/*",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt/x64",
You may change the drive name and folder name accordingly.
2.change your shell setting in settings.json:
"terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe",
"terminal.integrated.shellArgs.windows": ["/k", "D:/Program Files/Microsoft/MSVC2017/Common7/Tools/VsDevCmd.bat"]
which will enable the cl command in your integrated terminal.
3.Press ctrl+` to enable integrated terminal, type cl /EHsc your_cpp_program.cpp to compile.
I think easiest way to get it - open visual studio 2017 command prompt console and run Visual Studio Code IDE from there so it will pick all necessary compiler environment variables

Why is this configuration for ESLint in Visual Studio 2017 not working?

I am currently wondering, why ESLint is not working in my project in Visual Studio 2017. There is the file ".eslintrc" in the project-root:
{
"extends": "defaults/configurations/eslint",
"env": {
"browser": true
},
"globals": {
"xhr": true
},
"rules": {
"eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}
If I remove the line with "eqeqeq", everything is working fine. But as soon as I add this line, no errors will be displayed at all.
Question 1: Is there any way to see an error-message about the issue ESLint obviously has?
Question 2 as a fallback: What is the issue with this line?
Thanks to btmills I took a dive into the sources and found the version: VS 2017 uses ESLint 2.0.0 (released 2016-02-12).
The correct configuration is:
"eqeqeq": [ 2, "allow-null" ]
Documentation is available here:
Getting started
Rules
The links from the error-list in VS 2017 lead to the current documentation, where you can find many features that do not work in version 2.0.0.

Turning off "Language Service Disabled" error message in VS2017

We are getting the following "Error" message in our MVC web application in Visual studio 2017 Enterprise.
The language service is disabled for project 'C:\Work\Blackhawk
Platform\Platform-DEV-Branch\BlackhawkViewer\BlackhawkViewer.csproj'
because it included a large number of .js files. Consider excluding
files using the 'exclude' section of a 'tsconfig.json' file.
I have tried turning off the Language service in the options but this does not turn the message off:
This is a rather large web application. Is there a way to turn this message off without disabling any files in the tsconfig.json file as it suggests?
To solve this issue do the following:
Create file in root directory of your project and call it tsconfig.json
Add this:
{
"compilerOptions": {
"allowJs": true,
"noEmit": true,
"module": "system",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
},
"include": [
"scripts"
],
"exclude": [
],
"typeAcquisition": {
"enable": true
}
}
Please have a look at the below two links for tsconfig.json explanation, because you may still need to change it according to your setup. This is the only way that worked for me. I hope that will help.
https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
https://developercommunity.visualstudio.com/content/problem/8148/javascript-intellisense-not-working.html
This helped me. You can have a try.
Go to Tools -> Options -> Text Editor -> JavaScript/TypeScript -> Language Service -> General
and uncheck the box: "Enable the new JavaScript language service.
I have found a solution for this problem.
I reset my userData using:
devenv.exe /resetuserdata
Since doing this the JavaScript settings seem to have persisted and I no longer get the language service error above.
TAKE NOTE: This will reset all your user data and customisations.
In My case I just disable TypeScript support on Visual Studio:
Tools > Extensions and Updates > TypeScript for Microsoft Visual Studio > Disable
After that, just restart Visual Studio, and you are good to go.
Hope this will help,
I had the same problem after migrating Ionic 1 project from VS2015 to VS2017, first I executed git clean -fxd as sugested above and added this content into tsconfig.json in my ionic project.
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"exclude": [
"node_modules",
"www",
"bower_components"
]
}
I solved this problem with following solution:
When you have a JavaScript file that is included in the project.csproj file but isn't in the project folder, this error occurred.
For example I have a .csproj file like below:
<ItemGroup>
<Content Include="Scripts\Test.js" />
</ItemGroup>
The Test.js is included in the .csproj file, but it isn't in the Scripts folder:
Delete the <Content Include="Scripts\Test.js" /> line from the .csproj file and rebuild your project
Solution that worked for me:
Go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>.
Open command prompt as admin in current folder
Ran devenv /Setup
Ran devenv /ResetSkipPkgs
For me is helping the next solution. I've create a tsconfig.json file in root of the my project with "disableSizeLimit": "true" option.
So, my tsconfig.json file is:
{
"compilerOptions": {
"disableSizeLimit": "true"
},
"exclude": []
}
If none of suggested methods worked, try:
npm install -g typescript#latest
and then
Install the latest version of TypeScript for Visual Studio on Get TypeScript.