Need private packages and team management tools?Check out npm Teams »

jscs-require-space-inside-curly-braces

0.0.3 • Public • Published

jscs-require-space-inside-curly-braces

JSCS plugin to enforce space after open curly braces.

Getting started

To install the module, invoke:

npm install -g jscs-require-space-inside-curly-braces --save-dev

It is best to install this plugin globally to ensure that other Linters e.g. SublimeLinter is able to use this rule and to highlight wrong syntax.

Rule

To be able to use this rule, add the following to your JSCS configuration file:

"plugins": ["jscs-require-space-inside-curly-braces"],
"requireSpaceInsideCurlyBraces": true
 

This rule checks missing whitespace after open curly braces and reports style error.

Example

Valid

var obj = { };
 
var x = function a () { return 'z' };
 
var y = function () { return 'zzz' };
 
var z = function a () {
          return 1; };

Invalid

var obj = {}; // Missing whitespace after open curly brace
 
var x = function a () {return 'z' }; //Missing whitespace after open curly brace
 
var x = function a () { return 'z'}; //Missing whitespace before close curly brace

License

The MIT License (MIT)

Copyright (c) 2015 ArtificialUnit GbR

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Install

npm i jscs-require-space-inside-curly-braces

DownloadsWeekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • avatar