This project is read-only.

Problem sharing JSLintNet.json across projects when using MSBuild

May 11, 2014 at 12:57 PM
I have a solution with multiple projects, in which I would like to share the JSLintNet.json across the different projects. I have done as recommended here

i.e. adding JSLintNet.json to the solution file and then adding the file as a link in the project files. This seem to work perfectly fine when running JSLint from Visual Studio, but not when invoking JSLint through the build targets (from the NuGet package). Any ideas on this one?
May 11, 2014 at 10:16 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
May 11, 2014 at 10:18 PM
Yes, I think this is a bug. No short term workaround other than copying the .json file for now.

I think it should be possible to detect the linked file from MSBuild.
May 12, 2014 at 11:27 PM
Thanks for the fast reply. We will just copy the .json for now.
May 17, 2014 at 10:59 AM
I started to look into this, and it turns out there is actually an existing solution.

JSLint.NET for MSBuild supports a "JSLintNetSettingsFile" property. It's intended to let you override the default settings file name and location. So assuming the settings file is one folder back from the project, it should be possible to add the following to your project file's opening <PropertyGroup>:
I will still try to improve the experience in the future so it's possible to get a linked settings file for free in MSBuild, but this should work now.

Please let me know if you try it and how you go.
Jun 12, 2014 at 1:54 PM
Now we just tried this, and it seems to work perfectly! Thanks a lot. :)
Jul 29, 2014 at 10:26 AM
I've just put in some code to automatically detect a linked settings file from MSBuild. If an explicit path is set (i.e. using JSLintNetSettingsFile) it will take precedence.

This will be included in the next release.