This repository has been archived by the owner on Apr 24, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
A new version was just released of
jscs
, so Depsyhas upgraded your project's dependency ranges.
Make sure that it doesn't break anything, and happy merging!
Upgraded jscs to ^2.3.4
Changelog:
Version 2.3.4
Version 2.3.4 (10-17-2015):
Bug Fixes
requireVarDeclFirst
to ignore let and const2199ca4
#1783
a2c009f
#1175
@hzoo
Version 2.3.3
Version 2.3.3 (10-16-2015):
Bug Fixes
disallowUnusedParams
and es6 imports63526b7
#1875
cf134a1
#1873
@hzoo
Version 2.3.2
Version 2.3.2 (10-14-2015):
Fix an issue with
--extract
option being true by defaultVersion 2.3.1
Version 2.3.1 (10-14-2015):
A bunch of bug fixes in this release!
The Future
We are probably going to start 3.0 for the next release (mainly integrating CST into JSCS). If you want to know more about CST check out the previous changelog.
Our current plan is to move our 3.0/cst branch to master and then create a 2.x branch to continue to release bug fixes / contributer PRs. The core team will be mainly focused on tackling issues on our 3.0 roadmap (which we are still planning). We would love to hear your feedback on what you think should be in 3.0 and beyond!
Bug Fixes:
disallowMultipleVarDecl
- improve{"allExcept": ["require"]}
logic (ValYouW)disallowSpaceAfterObjectKeys
- Allow no space after key withalign
option. (Andrey Ermakov)disallowUnusedParams
- correctly output unused param name (Oleg Gaidarenko)requireDollarBeforejQueryAssignment
- validate all keys (Brian Dixon)requireDollarBeforejQueryAssignment
- Ignore arraydestructuring (Simen Bekkhus)
CLI
- "auto-configure" argument should always be at the end(Oleg Gaidarenko)
js-file
- make parser not confuse token types (Oleg Gaidarenko)Again, a big thanks to everything using JSCS! Definitely continue to report any bugs and new ideas! We always appreciate any help/PRs!
We'll probably be moving more of the new rule/option issues to
orphaned
which just means that they are on hold but anyone can still PR it or reopen it later. Remember to tweet at us at @jscs_dev and chat with us on our gitter room!@hzoo
Version 2.3.0
Version 2.3.0 (10-07-2015):
A quick update! A few more rules, preset updates, and bug fixes!
Now that we're done implementing all of ES6 the next major thing we'll be working on is intergrating CST into JSCS.
New Rules:
disallowIdenticalDestructuringNames
(ES6) (Henry Zhu)disallowNestedTernaries
(Brian Dixon)requireSpaceAfterComma
(Brian Dixon)Preset Updates:
94f175e
wordpress
- changerequireCamelCaseOrUpperCaseIdentifiers
fromtrue
toignoreProperties
58ba037
Bug Fixes:
disallowParenthesesAroundArrowParam
- account for non-identifiers (RestElement
,ArrayPattern
) correctly (Henry Zhu)bcfaa51
#1831disallowCommaBeforeLineBreak
correctly handle empty object (Oleg Gaidarenko)6571ebb
#1841Again, a big thanks to everything using JSCS! Definitely continue to report any bugs and new ideas! We always appreciate any help/PRs as we don't have that many resources!
@hzoo
Other
disallowMultipleVarDecl
typo (ValYouW)Checker
- return correct arguments for excluded files (Oleg Gaidarenko)Version 2.2.1
Version 2.2.1 (09-29-2015):
Bug Fix:
Quick fix related to checker not returning correctly with excluded files.
f12830a
#1816Checker
- return correct arguments for excluded files (markelog)Version 2.2.0
Version 2.2.0 (09-28-2015):
Again, it's been way too long since the last version; we're going to be releasing more often in the future!
In this release, we have a nicer homepage, 5 new rules, 4 more autofixable rules, many new rule options/bug fixes, and a jscs-jsdoc@1.2.0 update.
We also added support for using YAML in config files, checking JS style in HTML files, and are trying out some non-stylistic rules (like
disallowUnusedParams
)!Be on the look out for https://github.com/cst/cst (just finished ES6 support this weekend) if you haven't already.
Autofixing: Support for 4 more rules!
Thanks to @markelog, we also have autofix support for the following rules:
disallowSemicolons
requireSemicolons
disallowQuotedKeysInObjects
requireCapitalizedComments
Configuration: YAML support, and linting JS in HTML files
We weren't even thinking about different config formats, but @ronkorving stepped in and added support for using YAML as a config format!
So now you can use a
.jscsrc / jscs.json
(JSON) file or a.jscs.yaml
(YAML) file.@lahmatiy has landed support for linting javascript in HTML files with the extract option! Thanks so much for sticking with us for that PR.
Example usage:
New Rules
disallowMultiLineTernary
(Brian Dixon)requireMultiLineTernary
(Brian Dixon)disallowTabs
(Mike Ottum)It disallows tab characters everywhere!
disallowUnusedParams
(Oleg Gaidarenko)Another cool rule @markelog added is actually a non-stylistic rule with autofixing support! It checks to make sure you use the parameters in function declarations and function expressions!
validateCommentPosition
(Brian Dixon)Comments that start with keywords like
eslint, jscs, jshint
are ignored by default.Just as a reminder, you can disable certain AST node types with the
disallowNodeTypes
rule which takes in an array of node types.For example: if you want to disable arrow functions for some reason, you could do
"disallowNodeTypes": ['ArrowFunctionExpression']
.Presets: Idiomatic.js and other updates
We finally added support for Idiomatic.js! There are a few more rules we still need to add, so leave a comment in the issue or create a new one.
Google
: removecapitalizedNativeCase
option in the JSDoccheckTypes
rule (Sam Thorogood)Idiomatic
: add initial preset (Henry Zhu)jQuery
: adddisallowSpacesInCallExpression
rule to (Oleg Gaidarenko)jQuery
: useignoreIfInTheMiddle
value forrequireCapitalizedComments
rule (Oleg Gaidarenko)jQuery
: addvalidateIndentation
rule (Oleg Gaidarenko)Wikimedia
: enablees3
(James Forrester)Rule Options/Changes
requireSpacesInsideParentheses
:ignoreParenthesizedExpression
option (Oleg Gaidarenko)disallowSpaceAfterObjectKeys
: addmethod
exception option (Alexander Zeilmann)disallowSpaceBeforeSemicolon
: addallExcept
option (Oleg Gaidarenko)requireCapitalizedComments
: addignoreIfInTheMiddle
option (Oleg Gaidarenko)disallowSpacesInsideParentheses
: add quotes option (Oleg Gaidarenko)requireSpacesInsideParentheses
: add quotes option (Oleg Gaidarenko)requireCapitalizedComments
: add default exceptions (alawatthe)requireArrowFunctions
: create an error on function bind (Henry Zhu)Bug Fixes
We fixed a bug with exit codes not matching the wiki (Oleg Gaidarenko).
disallowParenthesesAroundArrowParam
: fix check for params (Henry Zhu)spacesInsideBrackets
: account for block comments (Oleg Gaidarenko)disallowSemicolons
: ignore needed exceptions (Oleg Gaidarenko)spacesInFunctionExpression
: account for async functions (MikeMac)disallowSpaceBeforeSemicolon
: do not trigger error if it's first token (Oleg Gaidarenko)requireCapitalizedComments
: consider edge cases (Oleg Gaidarenko)requireSemicolons
: handle phantom cases (Oleg Gaidarenko)spaceAfterObjectKeys
: fix for computed properties with more than one token (Henry Zhu).git
folder by default (Vladimir Starkov)JSDoc updates
checkParamExistence
requireReturnDescription
enforceExistence
addparamless-procedures
exceptionWhat's JSCS?
The homepage now showcases what JSCS actually does. We were missing a 🐱 picture as well so ...
༼ つ ◕_◕ ༽つ GIVE CST!
We've also been busy working on https://github.com/cst/cst.
CST stands for
Concrete Syntax Tree
, as opposed to AST which stands forAbstract Syntax Tree
. CST uses a regular AST but adds support for information that you normally don't care about but is vital for a style checker, e.g. spaces, newlines, comments, semicolons, etc. Using a CST will allow us to support more complex autofixing such as adding curly braces while retaining other formatting or much larger transformations.We just finished supporting all of ES6 this past weekend. ES6+ and JSX support is also in progress! We'll be integrating CST into JSCS in the 3.0 branch, so look out for that soon (CST uses babel as its AST parser).
If you're interested, there was a lot of discussion on CSTs at the ESTree repo.
Hopefully we can get more community help for JSCS! (check out CONTRIBUTING.md if you're interested)
We have a
beginner-friendly
tag for people to get started on issues.Small personal sidenote
Thanks to everyone who has been submitting issues/PRs!
It's been almost a year since I (@hzoo) really started contributing to open source. It's still crazy to me that my first pull request was just adding the table of contents. I was so excited to contribute that day!
Little did I know I would slowly do more and more - typo fixes, docs changes, bugfixes, rules, and then eventually become part of the team! I've become a better communicator and become more confident to give and take constructive feedback. I'm currently still figuring out how to review PRs, label issues, do changelogs (like right now), release, etc.
So much has happened after starting that one simple contribution! Even though I know a lot more about ASTs, javascript/node, and programming style, it all adds up to much more than that technical knowledge.
Contributing here helped me make PRs to a lot of other projects (in my case babel, eslint, and others). I understand more that it doesn't take a special person to start helping out. I really hope to encourage others to join our awesome open source community at large!
@hzoo
Other Awesome Changes!
describe
description (Roman Dvornov)handleMaxErrors
helper to the more appropriate place (Oleg Gaidarenko)maxErrors
toInfinity
for autoconfigure (Henry Zhu)disallowSemicolons
rule (Oleg Gaidarenko)requireCapitalizedComments
(Alexander Zeilmann)disallowParenthesesAroundArrowParam
(Samuel Lindblom)disallowMultipleSpaces
(Marián Rusnák)requireBlocksOnNewline
(Marián Rusnák)requireCapitalizedComments
(Marián Rusnák)disallowEmptyBlocks
rule (Oleg Gaidarenko)getScope
method (Oleg Gaidarenko)removeToken
method (Oleg Gaidarenko)file#getNodeRange
(Oleg Gaidarenko)only
property toreportAndFix
assert helper (Oleg Gaidarenko)requireSemicolons
rule to our jscsrc (Oleg Gaidarenko)requireCapitalizedComments
: remove merge artefacts (Oleg Gaidarenko)*Semicolons
: increase coverage (Oleg Gaidarenko)file
instance to_fix
method (Oleg Gaidarenko)BOM
from config files (Jonathan Wilsson)null
and-1
values formaxErrors
option (Daniel Anechitoaie)reportAndFix
assertion helper (Oleg Gaidarenko)isPragma
method (Brian Dixon)Version 2.1.1
Version 2.1.1
Overview
This release consists mostly of bug-fixes. Check them out – there are a lot of them!
We also managed to squeeze two new rules - requireSpacesInsideParenthesizedExpression and disallowSpacesInsideParenthesizedExpression, increase performance, and improve ES6 support.
Fix regarding global jscs installs and plugins
One of the biggest issues fixed: a global jscs install can finally load local extensions (à la gulp style) like error-filters, plugins, additional rules, and presets.
This will fix issues with using a custom preset with something like SublimeLinter which uses the global jscs install.
jscs-preset-
or withjscs-config-
to help with searching for presets on npm and defining it in your config”preset”: “awesome”
instead of”preset”: “jscs-preset-awesome”
”preset”: “awesome/super-awesome”
, provided that you havesuper-awesome.{json, js}
in your package root directoryjscs.json
file to store your jscs configpackage.json
, set themain
field tojscs.json
We will add more comprehensive documentation for this feature a bit later, so stay tuned.
Disable a rule with
false
ornull
You can use
false
(instead of onlynull
) to disable a rule (such as in a preset). This was a point of confusion for newer users. To disable a rule you can do:New Rules
Enhancements
Bug Fixes
for..of
statements (regseb)Misc
Docs
Version 2.1.0
Version 2.1.0
Overview
In this release, we added three more rules: two of them are ES6-only, they "protect" you
from the downside of arrow functions (see 1 and 2 for an explanation of why you might want to enable them) and another universal one if you like to keep your object neat and tidy.
Airbnb, jQuery, and Wordpress presets are now using some of the new rules we added in the previous release. Whereas, the wikimedia preset is now less strict for JSDoc comments.
This release also includes a JSON reporter, lots of bug fixes and enhancements, plus couple new rule values for your linting pleasure.
Presets
New rules
New rule values
Enhancements
Bugs
Docs
Misc
node_modules
dir in travis CI (Oleg Gaidarenko)Version 2.0.0
Version 2.0.0
Overview
Gosh! We haven’t released a new version in more than two months! What have we done all this time?
Well, we were working hard on the next big step - 2.0!
And we’re finally ready to show it to you. We’ve improved JSCS all over the place!
esnext
It was a big pain to check ES6/JSX code with JSCS, since you had to install special extensions or different parsers. Well, no more of that! Thanks to all the hard work of the @hzoo, now you can just write
"esnext": true
in your config or execute JSCS from the CLI with the--esnext
flag.Now all that new fancy code will be examined without any hassle, as decorators, function bind (::) operator, and all valid babel code can be checked by JSCS.
We also added seven ES6-only rules; see below for more information.
Autofixing
We really want to support autofixing for as many rules as possible. But as it turns out, we are at forefront of this problem; it’s really hard to change the code without affecting unrelated instructions.
What we need is a Concrete Syntax Tree, instead of the AST + tokens structures that we use now. Unfortunately, there is no CST standard for JavaScript at the moment – this is why we decided to step up and come up with our vision of a CST - https://github.com/mdevils/cst. Currently, we are working with the estree team on this proposal – hoping the development of this crucial part of JavaScript parsing will move faster.
Meanwhile, using some workarounds and hacks, we managed to support autofixing for 4 more rules:
New rules
There are 31 new rules, including 16 rules for JSDoc validation, and 7 ES6-only rules:
Require spaces before commas
Disallow spaces before commas
Requires
var
declaration to be on the top of an enclosing scopeDisallows spaces before semicolons.
Requires function names to match member and property names.
Disallow use of certain node types (from Esprima/ESTree).
Requires placing object keys on new line
Disallows placing object keys on new line
New ES6-only rules
Disallows parentheses around arrow function expressions with a single parameter.
Requires that arrow functions are used instead of anonymous function expressions in callbacks.
Requires use of binary, hexadecimal, and octal literals instead of
parseInt
.Requires parentheses around arrow function expressions with a single parameter.
Require arrow functions to use an expression body when returning a single statement
Disallows using
.apply
in favor of the spread operatorRequires the use of template strings instead of string concatenation.
There are also a lot of new rule values (see the "Changelog" section) which makes a lot of rules more flexible.
We also added new rules and values to some presets. If you feel that we’ve missed something, don't be quiet! Send us a PR and we will surely add the needed rules to your favorite preset.
Simplified inclusion of plugins, presets, and custom rules
Since every possible JSCS extension can now be loaded without defining its full path, it is enough to just specify the needed dependency to your project so it can be found by JSCS.
Other
summary
(could be very helpful to acquire full overview of all possible errors in your project) andunix
. You could enable them by providing--reporter=<reporter name>
flag.node_modules
path is included by default toexcludeFiles
And of course, a lot of bug-fixes, improved ES6 support of existing rules, docs, infrastructure changes, etc.
Although this is major version, we didn't remove deprecated rule values or changed config format, we expecting to do this in the 3.0 version while switching to CST and fully refactor JSCS code-base.
Changelog
Backward incompatible changes
node_modules/
by default (Louis Pilfold)Autofix
Preset
New rules
New rule values
Enhancements for ES6 support
Inline control
New reporters
Bug fixes
Docs
true
value description (Adrian Heine né Lang)Misc
Version 1.9.0
Presets
New Rules
Bug Fixes
Infrastructure
Docs
Version 1.8.1
Version 1.8.0
Presets
New Rules
New Options
New Rule Options
Bug Fixes
finally
as a spaced keyword (Todd Wolfson)Docs
Version 1.7.3
Version 1.7.2
Version 1.7.1
Version 1.7.0
Version 1.6.2
Version 1.6.1
Version 1.6.1
Version 1.6.0
Version 1.5.9
Version 1.5.8
if
that has blockelse
. (Mike Sherov)Version 1.5.7
Version 1.5.6
Version 1.5.4
Fix crash caused by multiline case statements that fall through for validateIndentation rule (Mike Sherov)
Version 1.5.3
Version 1.5.1
Version 1.5.2
Version 1.4.5
Hotfix: Fix binary rules for "," and "=" operators (@markelog)
Version 1.4.4
requireSpaceAfterBinaryOperators
rule: support comma and assignment operators (@markelog)disallowSpaceAfterBinaryOperators
rule: support comma and assignment operators (@markelog)requireSpaceBeforeBinaryOperators
rule: support comma and assignment operators (@markelog)disallowSpaceBeforeBinaryOperators
rule: support comma and assignment operators (@markelog)requirePaddingNewlinesInBlocks
: support multi-line padding (@zz85)requireSpacesInConditionalExpression
(@mikesherov)disallowSpacesInConditionalExpression
(@mikesherov)validateIndentation
rule: fix more weird onevar constructs and associated indentation rules (@mikesherov)validateIndentation
rule: fix bug when IfStatement test contains a BlockStatementVersion 1.4.3
Version 1.4.2
requireSpaceAfterKeywords
: do not fail on linebreaks (@mdevils).Version 1.4.1
disallowPaddingNewlinesInBlocks
: check for comments in the whitespace. Fixes #347 (@mikesherov).validateIndentation
rule: properly validate finally clauses. Fixes #311 (@mikesherov).validateIndentation
rule: tests for holes in array and more complex temporary fix for it (@zxqfox).validateIndentation
rule: allow for extra indents when first variablein a declaration is multi-line (@mikesherov).
validateIndentation
rule: prevent false positive when array elements areon same line as array opener, but array is not single line. Fixes #353 (@mikesherov)
Version 1.4.0
node.js
0.8 support.vow
/vow-fs
(@XhmikosR).requireSpaceAfterKeywords
rule: trigger error if there is more then two spaces (@markelog).spaceAfterKeywords
: fix up funarg issue (@markelog).requireMultipleVarDecl
rule more like onevar (@markelog).disallowSpacesInsideParentheses
(@Famlam).disallowTrailingComma
(@rxin).requireTrailingComma
(@rxin).disallowSpaceBeforeBlockStatements
(@rxin).requireSpaceBeforeBlockStatements
(@rxin).requireBlocksOnNewline
(@mikesherov).requirePaddingNewlinesInBlock
(@mikesherov).disallowPaddingNewlinesInBlock
(@mikesherov).Version 1.3.0
.jscsrc
. JSON-file with comments.requireBlocksOnNewline
(@Famlam).requireSpacesInAnonymousFunctionExpression
(@jamesallardice).disallowSpacesInAnonymousFunctionExpression
(@jamesallardice).requireSpacesInNamedFunctionExpression
(@jamesallardice).disallowSpacesInNamedFunctionExpression
(@jamesallardice).escape
for rulevalidateQuote
(@mikesherov).validateIndentation
rule (@mikesherov).excludeFiles
option (@markelog).Version 1.2.4
validateIndentation
rule.Version 1.2.3
inline
(@clochix).requireDotNotation
(@ikokostya).Version 1.2.0
requireCommaBeforeLineBreak
(@mikesherov).disallowCommaBeforeLineBreak
(@mikesherov).requireDotNotation
(@mikesherov).requireCamelCaseOrUpperCaseIdentifiers
(@mikesherov).disallowEmptyBlocks
(@mikesherov).validateQuoteMarks
(@mikesherov).requireParenthesesAroundIIFE
(@mikesherov).requireOperatorBeforeLineBreak
(@mikesherov).requireCapitalizedConstructors
(@mikesherov).disallowDanglingUnderscores
(@mikesherov).disallowTrailingWhitespace
(@mikesherov).case
anddefault
statements (@mikesherov).maximumLineLength
(@mikesherov).disallowMixedSpacesAndTabs
(@mikesherov).validateIndentation
(@mikesherov).requireSpaceBeforePostfixUnaryOperators
,requireSpaceAfterPrefixUnaryOperators
,disallowSpaceBeforePostfixUnaryOperators
,disallowSpaceAfterPrefixUnaryOperators
(@mdevils).disallowMultipleLineStrings
(@mikesherov).Version 1.2.1
maximumLineLength
(@pdehaan).Version 1.2.2
requireDotNotation
rule (@andrewblond).