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 510
"requireSpaceAfterKeywords" should ignore object keys #83
Labels
Comments
The problem here lies within the use of Esprima's "tokens" vs the full "body" tree object. For a simple test-case we can see: test.js x = { for: 'bar' }; The "for" part in the tokens array produces: {
"type": "Keyword",
"value": "for",
"range": [
6,
9
],
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
}
}, but in the "body" property, it produces this ouput: "key": {
"type": "Identifier",
"name": "for",
"range": [
6,
9
],
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
}
}, Because the tokens array (perhaps incorrectly?) puts the "type" as "Keyword", which is no different to a real Possible Solutions
|
markelog
added a commit
to markelog/node-jscs
that referenced
this issue
Jan 22, 2014
markelog
added a commit
to markelog/node-jscs
that referenced
this issue
Jan 22, 2014
Replaces type of reserved keywords if the are object keys. See https://code.google.com/p/esprima/issues/detail?id=481 for more info Fixes jscs-dev#83, jscs-dev#180
markelog
added a commit
to markelog/node-jscs
that referenced
this issue
Jan 22, 2014
Replaces type of reserved keywords if the are object keys. See https://code.google.com/p/esprima/issues/detail?id=481 for more info Fixes jscs-dev#83, jscs-dev#180
markelog
added a commit
to markelog/node-jscs
that referenced
this issue
Jan 22, 2014
Replaces type of reserved keywords if the are object keys. See https://code.google.com/p/esprima/issues/detail?id=481 for more info Fixes jscs-dev#83, jscs-dev#180
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following rule:
Will complain about the following code:
I believe this is incorrect. Object keys should be ignored for "requireSpaceAfterKeywords"
@Gissues:{"order":50,"status":"done"}
The text was updated successfully, but these errors were encountered: