How to run JSCS on save only (not on keypress) in Atom? - atom-editor

I'm using https://github.com/AtomLinter/linter-jscs. The docs say:
It will lint on edit and/or on save
It seems that it lints on edit and save all the time. I don't see a way to configure it to lint on only save.

First of all you really should be looking into moving to ESLint (linter-eslint) as all development on JSCS has stopped.
As for your question, you can configure this behavior in the Linter package by disabling On-the-fly linting there. This package is simply a service provider allowing linting of code through JSCS, the Linter package is what controls when it is ran, and how its results are displayed to the user.

Related

WebStorm Firebase Integration

I'm pretty new to Firebase, and Web Development in general. Does anyone know how to avoid errors like these in WebStorm?
Ideally I would like to be able to point Webstorm towards some resource so it recognizes these functions. Everything works and this is technically just an annoyance, but I haven't been able to find a solution.
To link Firebase as a library in WebStorm's JavaScript project do as follows:
Hit Ctrl+Alt+S to open Settings page.
Open page Language & Frameworks > JavaScript > Libraries
Hit ADD... button on right
Fill name as firebase
Hit + and Attach Directories
Find your node_modules\#firebase folder inside current project
You can OK twice to confirm and close Settings page
Now your Firebase is recognized by WebStorm and all #types are defined, and you can Ctrl+Click any function, and get code completion!
Best regards!
Adding firebase as a dependency to package.json and then doing npm install should do the trick – WebStorm fill index the source files and provide code completion for Firebase APIs.
Alternatively, you can download firebase-app.js and firebase-auth.js from the CDN and then configure them as a Library in WebStorm as described in the docs.

In VSCode-->settings.json, a particular line appears dimmer than the rest of the code. What is that indicating?

In VSCode, in settings.json for one of my extensions is a line
"extends": "C:/Users/snarl/.vscode/extensions/stylelint-config-wordpress",
But that line is dimmed compared to the rest of the text in the file, as if disabled, or path not found (screenshot). Is that indicating some kind of error I need to resolve? That folder does indeed exist at that location (screenshot).
Motivation For My Question
I ask because this is a line of code I manually added to settings.json, as part of installation instructions for a particular extension. I'm currently using the stylelint extension to help notify me of errors while I type. I am now trying to install a separate extension--stylelint-config-wordpress--which is a set of rules to be used with stylelint. But that new ruleset doesn't seem to be working properly. So I am now trying to troubleshoot why the new rules are not working properly. The settings.json file I edited is part of the stylelint-config-wordpress extension.
Of Note
I am running Windows 10.
When I initially installed stylelint, I installed it globally. I can confirm it was installed properly and linting errors in my code, as expected.
In the GitHub repo for stylelint-config-wordpress, there is one issue related to this (see here). I posted there and received some initial replies. But nothing worked, and I've not heard back since.
After opening an issue in the relevant GitHub repo, I was able to understand the answer to my question.
Short Answer: The code I was adding was incorrect. I was adding:
extends": "C:/Users/snarl/.vscode/extensions/stylelint-config-wordpress",
when I should have been adding something more along the lines of this:
"stylelint.config": {
"extends": "C:/Users/snarl/index.js"
},
Long Answer: If anyone is really curious about how to get this ruleset working in VSCode, you can read this issue.

How do I install and use the custom CSSLint rules I have written for the CLI?

I am using CSSLint via the CLI. I have spent quite a bit of time following the steps found here and here to write custom css linting rules. They are tested and they work correctly, however now that I have created the rules I am not sure how to actually add them to the linter (or installed via npm) so that can be used via the CLI to lint my projects. I have scoured the documentation in the github wiki and cannot seem to find an answer.
Keep in mind these rules are project specific and they are not meant to be submitted to the csslint github repo.
Figured it out. I used 'grunt release' and then published it as an npm module, and then installed it. The cause for the issue was that I needed to uninstall the original version of cssLint as it was overriding the new one.

sbt: Prevent erroneous command being issued?

I have an sbt project in which the build is normally invoked via package-tar. If a developer types package, it's very likely that they actually meant package-tar instead.
However, package-tar depends on package. How can I prevent or deter or warn when a developer seems to be making this mistake - since I can't actually disable the package task because it's necessary?
I considered integrating actual deployment into the build, but this is not compatible with our current deployment process.
Instead of making package-tar a separate task, how about just redefining package to do what you want? The new behavior can invoke the old behavior.
http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Artifacts.html has examples of customizing what package does. The material on addArtifact looks relevant.

Configuring *all* JSHint settings in WebStorm IDE

After a somewhat comprehensive evaluation of IDEs for use in front end development, WebStorm leads the pack I think.
The one missing piece is that we can't configure JSHint the way we need to. The WebStorm preferences GUI provides some options, but not the full set. The GUI only lets you configure 15 of the 30 or so actual available options.
This is a problem because we don't want to change our coding practices just because an IDE doesn't let us configure linting the way we want.
Is there a hacky way to go in and adjust the JSHint library behind the scenes for WebStorm?
You can configure all the options you'd like in a .jshintrc file located in the root directory of your project. This will be a project-wide setting.
From https://www.jetbrains.com/webstorm/webhelp/jshint.html:
Use config files
Select this check box to have the code verified according to the settings from a configuration file. A configuration file is a JSON file with the extension .jshintrc that specifies which JSHint options should be enabled or disabled. WebStorm will look for a .jshintrc file in the working directory. If the search fails, WebStorm will search in the parent folder, then again in the parent folder. The process is repeated until WebStorm finds a .jshintrc or reaches the project root. To have WebStorm still run verification in this case, specify the default configuration file to use.
I've been using this for a while and it works great. Plus you can commit it to your repo and ensure the entire team follows the same code style. Also a great place to add globals.
I'm not aware of any hacky way to do it, but you can vote for the existing feature request.
There's a per-file solution that works, but is not ideal. Would prefer an IDE or project-wide fix/hack.
Set JSHint options at the top of your file:
/*jshint laxcomma:true, asi:true */

Resources