eslint 3.10.1 → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ v3.10.2 - November 15, 2016
2
+
3
+ * 0643bfe Fix: correctly handle commented code in `indent` autofixer (fixes #7604) (#7606) (Teddy Katz)
4
+ * bd0514c Fix: syntax error after `key-spacing` autofix with comment (fixes #7603) (#7607) (Teddy Katz)
5
+ * f56c1ef Fix: `indent` crash on parenthesized global return values (fixes #7573) (#7596) (Teddy Katz)
6
+ * 100c6e1 Docs: Fix example for curly "multi-or-nest" option (#7597) (Will Chen)
7
+ * 6abb534 Docs: Update code of conduct link (#7599) (Nicholas C. Zakas)
8
+ * 8302cdb Docs: Update no-tabs to match existing standards & improve readbility (#7590) (Matt Stow)
9
+
1
10
  v3.10.1 - November 14, 2016
2
11
 
3
12
  * 8a0e92a Fix: handle try/catch correctly in `no-return-await` (fixes #7581) (#7582) (Teddy Katz)
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  [Rules](http://eslint.org/docs/rules/) |
14
14
  [Contributing](http://eslint.org/docs/developer-guide/contributing) |
15
15
  [Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
16
- [Code of Conduct](https://jquery.org/conduct/) |
16
+ [Code of Conduct](https://js.foundation/conduct/) |
17
17
  [Twitter](https://twitter.com/geteslint) |
18
18
  [Mailing List](https://groups.google.com/group/eslint) |
19
19
  [Chat Room](https://gitter.im/eslint/eslint)
@@ -255,20 +255,18 @@ module.exports = {
255
255
  * @param {int} lastNodeCheckEndOffset Number of charecters to skip from the end
256
256
  * @returns {void}
257
257
  */
258
- function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck, lastNodeCheckEndOffset) {
258
+ function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) {
259
259
  if (gottenSpaces && gottenTabs) {
260
260
 
261
261
  // To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs.
262
262
  return;
263
263
  }
264
264
 
265
- lastNodeCheckEndOffset = lastNodeCheckEndOffset || 0;
266
-
267
- const desiredIndent = (indentType === "space" ? " " : "\t").repeat(needed - lastNodeCheckEndOffset);
265
+ const desiredIndent = (indentType === "space" ? " " : "\t").repeat(needed);
268
266
 
269
267
  const textRange = isLastNodeCheck
270
- ? [node.range[1] - gottenSpaces - gottenTabs - 1, node.range[1] - 1 - lastNodeCheckEndOffset]
271
- : [node.range[0] - gottenSpaces - gottenTabs, node.range[0]];
268
+ ? [node.range[1] - node.loc.end.column, node.range[1] - node.loc.end.column + gottenSpaces + gottenTabs]
269
+ : [node.range[0] - node.loc.start.column, node.range[0] - node.loc.start.column + gottenSpaces + gottenTabs];
272
270
 
273
271
  context.report({
274
272
  node,
@@ -406,13 +404,11 @@ module.exports = {
406
404
  */
407
405
  function checkLastReturnStatementLineIndent(node, firstLineIndent) {
408
406
  const nodeLastToken = sourceCode.getLastToken(node);
409
- let lastNodeCheckEndOffset = 0;
410
407
  let lastToken = nodeLastToken;
411
408
 
412
409
  // in case if return statement ends with ');' we have traverse back to ')'
413
410
  // otherwise we'll measure indent for ';' and replace ')'
414
411
  while (lastToken.value !== ")") {
415
- lastNodeCheckEndOffset++;
416
412
  lastToken = sourceCode.getTokenBefore(lastToken);
417
413
  }
418
414
 
@@ -433,8 +429,7 @@ module.exports = {
433
429
  endIndent.space,
434
430
  endIndent.tab,
435
431
  { line: lastToken.loc.start.line, column: lastToken.loc.start.column },
436
- true,
437
- lastNodeCheckEndOffset
432
+ true
438
433
  );
439
434
  }
440
435
  }
@@ -417,8 +417,8 @@ module.exports = {
417
417
  function report(property, side, whitespace, expected, mode) {
418
418
  const diff = whitespace.length - expected,
419
419
  nextColon = getNextColon(property.key),
420
- tokenBeforeColon = sourceCode.getTokenBefore(nextColon),
421
- tokenAfterColon = sourceCode.getTokenAfter(nextColon),
420
+ tokenBeforeColon = sourceCode.getTokenOrCommentBefore(nextColon),
421
+ tokenAfterColon = sourceCode.getTokenOrCommentAfter(nextColon),
422
422
  isKeySide = side === "key",
423
423
  locStart = isKeySide ? tokenBeforeColon.loc.start : tokenAfterColon.loc.start,
424
424
  isExtra = diff > 0,
@@ -17,7 +17,7 @@ const regex = /\t/;
17
17
  module.exports = {
18
18
  meta: {
19
19
  docs: {
20
- description: "disallow tabs in file",
20
+ description: "disallow all tabs",
21
21
  category: "Stylistic Issues",
22
22
  recommended: false
23
23
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "3.10.1",
3
+ "version": "3.10.2",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {