Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
grunt-jscs
Advanced tools
Task for checking JavaScript Code Style with jscs.
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-jscs --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks("grunt-jscs");
Run this task with the grunt jscs
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Any specified option will be passed through directly to JSCS, plus this plugin has additional options:
Type: String
, Boolean
Default value: true
Defines how to externally load a JSCS configuration via the JSCS config loader. The following is the behavior of this option:
true
, JSCS will use its default config loading behavior;true
or to a file path with JSCS options specified in the grunt task, then they will be merged.jscs: {
src: "path/to/files/*.js",
options: {
config: ".jscsrc",
esnext: true, // If you use ES6 http://jscs.info/overview.html#esnext
verbose: true, // If you need output with rule names http://jscs.info/overview.html#verbose
fix: true, // Autofix code style violations when possible.
requireCurlyBraces: [ "if" ]
}
}
Type: Boolean
Default value: false
Set force
to true
to report JSCS errors but not fail the task.
Type: String
Default value: null
Allows you to modify the output. By default it will use a built-in grunt
reporter. Set the path to your own custom reporter or to one of the built-in JSCS reporters.
Type: String
Default value: null
Specify a filepath to output the results of a reporter. If reporterOutput
is specified then all output will be written to the given filepath instead of printed to stdout.
jscs: {
main: [ "path/to/files/*.js" ],
secondary: {
options: {
config: ".jscs-secondary",
},
files: {
src: [ "path/to/more/files/**/*.js", "my-plugin.js" ]
}
},
ternary: {
options: {
requireCurlyBraces: [ "if" ]
},
files: {
src: "happy-hippo.js"
}
}
}
See the releases page.
FAQs
Grunt task for checking JavaScript Code Style with jscs.
The npm package grunt-jscs receives a total of 9,821 weekly downloads. As such, grunt-jscs popularity was classified as popular.
We found that grunt-jscs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.