This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 515
False positive for "!" in disallowSpaceAfterPrefixUnaryOperators #87
Comments
wmfgerrit
pushed a commit
to wikimedia/oojs-core
that referenced
this issue
May 1, 2014
jshint: * Update to grunt-contrib-jshint v0.10.0 (jshint v2.5.0). * Remove coding style option "noempty" (already covered by jscs). * Remove option "regexp". * Enable new option "freeze" (prohibits changing native prototypes). http://www.jshint.com/blog/new-in-jshint-oct-2013/#option-freeze * Re-order to match http://www.jshint.com/docs/options/ jscs: * Update to grunt-contrib-jshint v0.4.2 (jscs v1.4.0). * Format .jscsrc file in a more spaceious way and order the properties less arbitrarily (using the jscs's readme order). * Enforce more details of our coding style: - requireCurlyBraces: Add more keywords that should have their code block wrapped in curly braces. - requireSpaceAfterKeywords: Add more keywords that should have a space after them. - requireMultipleVarDecl: Enable the new "onevar" checker (like jshint's "onevar"). Introduced in jscs v1.4.0. - disallowTrailingComma: Enable. - disallowKeywordsOnNewLine: Enable for "else". - requireSpaceBeforeBlockStatements: Enable. - requireBlocksOnNewline: Enable, but only when more than 1 statement (this still will validate shorthand like the following, which we make use of at the moment): var noop = function () { return true; }; - requireSpacesInFunctionExpression: Remove, this is already covered by requireSpaceAfterKeywords and requireSpaceBeforeBlockStatements, which enforce: x.noop = function () {}; x.Foo = function Foo() {}; - disallowSpacesInNamedFunctionExpression: Enable for the parenthesis. Disallows: x.Foo = function Foo () {}; - disallowSpacesInFunctionDeclaration: Enable for parenthesis. Disallows: function noop () {} - disallowDanglingUnderscores: Enable (like jshint's "nomen"). - disallowSpaceAfterPrefixUnaryOperators: Add "!" back, now that the bug where it conflicts with requireRightStickedOperators is fixed. jscs-dev/node-jscs#87 - disallowMixedSpacesAndTabs: Enable. - disallowYodaConditions: Enable. qunit: * Update to node-qunit v0.6.2 (does not ship qunitjs itself). (mostly minor changes) Change-Id: If46b94ce18a7084cf6b9a2223d770ea03386815e
wmfgerrit
pushed a commit
to wikimedia/VisualEditor
that referenced
this issue
May 14, 2014
jshint: * Update to grunt-contrib-jshint v0.10.0 (jshint v2.5.0). * Remove coding style option "noempty" (already covered by jscs). * Remove coding style option "curly" (already covered by jscs). * Remove option "regexp". * Enable new option "freeze" (prohibits changing native prototypes). http://www.jshint.com/blog/new-in-jshint-oct-2013/#option-freeze * Re-order to match http://www.jshint.com/docs/options/ jscs: * Update to grunt-contrib-jshint v0.4.2 (jscs v1.4.0). * Format .jscsrc file in a more spaceious way and order the properties less arbitrarily (using the jscs's readme order). * Enforce more details of our coding style: - requireCurlyBraces: Add more keywords that should have their code block wrapped in curly braces. - requireSpaceAfterKeywords: Add more keywords that should have a space after them. - requireMultipleVarDecl: Enable the new "onevar" checker (like jshint's "onevar"). Introduced in jscs v1.4.0. - disallowTrailingComma: Enable. - disallowKeywordsOnNewLine: Enable for "else". - requireSpaceBeforeBlockStatements: Enable. - requireBlocksOnNewline: Enable, but only when more than 1 statement (this still will validate shorthand like the following, which we make use of at the moment): var noop = function () { return true; }; - requireSpacesInFunctionExpression: Remove, this is already covered by requireSpaceAfterKeywords and requireSpaceBeforeBlockStatements, which enforce: x.noop = function () {}; x.Foo = function Foo() {}; - disallowSpacesInNamedFunctionExpression: Enable for the parenthesis. Disallows: x.Foo = function Foo () {}; - disallowSpacesInFunctionDeclaration: Enable for parenthesis. Disallows: function noop () {} - disallowDanglingUnderscores: Enable (like jshint's "nomen"). - disallowSpaceAfterPrefixUnaryOperators: Add "!" back, now that the bug where it conflicts with requireRightStickedOperators is fixed. jscs-dev/node-jscs#87 - disallowMixedSpacesAndTabs: Enable. - disallowYodaConditions: Enable. - disallowRightStickedOperators: Remove, this is obsolete with requireSpace{Before,After}BinaryOperators and fixes a bug where the following would be considered invalid when it shouldn't: +!!constructor.static.matchFunction // Operator + should not stick to following expression This is a false positive due to the tricky nature of disallowRightStickedOperators and for that reason this rule has been deprecated and scheduled for removal in jscs 2.0.0 See also If46b94ce18a7084cf and Ib731f11b1184d in oojs/core. Change-Id: Iccf3b461b8d01023dd698771183b0ad5816993b1
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Warning "Operator ! should stick to operand at example.js" keeps popping up no matter what I do to the offending line.
It looks like a false positive to me (perhaps the code doesn't account for the possibility of parenthesis to appear in that location?).
Warning:
example.js:
.jscs.json:
I've tried removing and adding all kinds of spaces to try and see if that satisfies it, but it seems impossible without changing anything other than whitespace.
The text was updated successfully, but these errors were encountered: