eslint 6.7.1 → 6.7.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
+ v6.7.2 - November 30, 2019
2
+
3
+ * [`bc435a9`](https://github.com/eslint/eslint/commit/bc435a93afd6ba4def1b53993ef7cf8220f3f070) Fix: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) (#12616) (Toru Nagashima)
4
+ * [`4928d51`](https://github.com/eslint/eslint/commit/4928d513b4fe716c7ed958c294a10ef8517be25e) Fix: don't ignore the entry directory (fixes #12604) (#12607) (Toru Nagashima)
5
+ * [`b41677a`](https://github.com/eslint/eslint/commit/b41677ae2a143790b19b0e70391a46ec6c8f5de1) Docs: Clarify suggestion's data in Working with Rules (refs #12606) (#12617) (Milos Djermanovic)
6
+ * [`ea16de4`](https://github.com/eslint/eslint/commit/ea16de4e7c6f661398b0b7843f95e5f307c89551) Fix: Support tagged template literal generics in no-unexpected-multiline (#11698) (Brad Zacher)
7
+ * [`fa6415d`](https://github.com/eslint/eslint/commit/fa6415d5b877370374a6a530a5190ab5a411b4dc) Sponsors: Sync README with website (ESLint Jenkins)
8
+ * [`e1e158b`](https://github.com/eslint/eslint/commit/e1e158b4d7bd61e812723b378d2c391295da43a5) Sponsors: Sync README with website (ESLint Jenkins)
9
+
1
10
  v6.7.1 - November 24, 2019
2
11
 
3
12
  * [`dd1e9f4`](https://github.com/eslint/eslint/commit/dd1e9f4df2103c43509a54b0ad5f9106557997f9) Fix: revert changes to key-spacing due to regression (#12598) (Kai Cataldo)
package/README.md CHANGED
@@ -265,7 +265,7 @@ The following companies, organizations, and individuals support ESLint's ongoing
265
265
  <h3>Gold Sponsors</h3>
266
266
  <p><a href="https://www.shopify.com"><img src="https://images.opencollective.com/shopify/eeb91aa/logo.png" alt="Shopify" height="96"></a> <a href="http://engineering.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://badoo.com/team?utm_source=eslint"><img src="https://images.opencollective.com/badoo/2826a3b/logo.png" alt="Badoo" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://opensource.facebook.com"><img src="https://images.opencollective.com/fbopensource/fbb8a5b/logo.png" alt="Facebook Open Source" height="96"></a></p><h3>Silver Sponsors</h3>
267
267
  <p><a href="https://www.ampproject.org/"><img src="https://images.opencollective.com/amp/c8a3b25/logo.png" alt="AMP Project" height="64"></a></p><h3>Bronze Sponsors</h3>
268
- <p><a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://www.crosswordsolver.com"><img src="https://images.opencollective.com/crosswordsolver/d4481d6/logo.png" alt="Crosswordsolver" height="32"></a> <a href="https://www.codacy.com/?utm_source=eslint&utm_medium=cpm&utm_campaign=eslint-sponsorship"><img src="https://images.opencollective.com/codacy/ed22716/logo.png" alt="Codacy" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/0b37d14/logo.png" alt="Free Icons by Icons8" height="32"></a> <a href="https://uxplanet.org/top-ui-ux-design-agencies-user-experience-firms-8c54697e290"><img src="https://images.opencollective.com/ui-ux-design-agencies/cae5dfe/logo.png" alt="UI UX Design Agencies" height="32"></a> <a href="https://clay.global"><img src="https://images.opencollective.com/clayglobal/2468f34/logo.png" alt="clay" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://tekhattan.com"><img src="https://images.opencollective.com/tekhattan/bc73c28/logo.png" alt="TekHattan" height="32"></a> <a href="https://www.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://jsheroes.io/"><img src="https://images.opencollective.com/jsheroes1/9fedf0b/logo.png" alt="JSHeroes " height="32"></a></p>
268
+ <p><a href="https://uxplanet.org/top-ui-ux-design-agencies-user-experience-firms-8c54697e290"><img src="https://images.opencollective.com/ui-ux-design-agencies/cae5dfe/logo.png" alt="UI UX Design Agencies" height="32"></a> <a href="https://edubirdie.com/"><img src="https://images.opencollective.com/edubirdie2/b1d51ab/logo.png" alt="EduBirdie" height="32"></a> <a href="https://www.crosswordsolver.com"><img src="https://images.opencollective.com/crosswordsolver/d4481d6/logo.png" alt="Crosswordsolver" height="32"></a> <a href="https://www.codacy.com/?utm_source=eslint&utm_medium=cpm&utm_campaign=eslint-sponsorship"><img src="https://images.opencollective.com/codacy/ed22716/logo.png" alt="Codacy" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/0b37d14/logo.png" alt="Free Icons by Icons8" height="32"></a> <a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://clay.global"><img src="https://images.opencollective.com/clayglobal/2468f34/logo.png" alt="clay" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://tekhattan.com"><img src="https://images.opencollective.com/tekhattan/bc73c28/logo.png" alt="TekHattan" height="32"></a> <a href="https://www.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://jsheroes.io/"><img src="https://images.opencollective.com/jsheroes1/9fedf0b/logo.png" alt="JSHeroes " height="32"></a></p>
269
269
  <!--sponsorsend-->
270
270
 
271
271
  ## <a name="technology-sponsors"></a>Technology Sponsors
@@ -375,9 +375,6 @@ class FileEnumerator {
375
375
  * @private
376
376
  */
377
377
  *_iterateFilesRecursive(directoryPath, options) {
378
- if (this._isIgnoredFile(directoryPath + path.sep, options)) {
379
- return;
380
- }
381
378
  debug(`Enter the directory: ${directoryPath}`);
382
379
  const { configArrayFactory, extensionRegExp } = internalSlotsMap.get(this);
383
380
 
@@ -426,7 +423,20 @@ class FileEnumerator {
426
423
 
427
424
  // Dive into the sub directory.
428
425
  } else if (options.recursive && stat && stat.isDirectory()) {
429
- yield* this._iterateFilesRecursive(filePath, options);
426
+ if (!config) {
427
+ config = configArrayFactory.getConfigArrayForFile(
428
+ filePath,
429
+ { ignoreNotFoundError: true }
430
+ );
431
+ }
432
+ const ignored = this._isIgnoredFile(
433
+ filePath + path.sep,
434
+ { ...options, config }
435
+ );
436
+
437
+ if (!ignored) {
438
+ yield* this._iterateFilesRecursive(filePath, options);
439
+ }
430
440
  }
431
441
  }
432
442
 
@@ -74,6 +74,14 @@ module.exports = {
74
74
  if (node.tag.loc.end.line === node.quasi.loc.start.line) {
75
75
  return;
76
76
  }
77
+
78
+ // handle generics type parameters on template tags
79
+ const tokenBefore = sourceCode.getTokenBefore(node.quasi);
80
+
81
+ if (tokenBefore.loc.end.line === node.quasi.loc.start.line) {
82
+ return;
83
+ }
84
+
77
85
  context.report({ node, loc: node.loc.start, messageId: "taggedTemplate" });
78
86
  },
79
87
 
@@ -90,6 +90,56 @@ function nodesOrTokensOverlap(first, second) {
90
90
  (second.range[0] <= first.range[0] && second.range[1] >= first.range[0]);
91
91
  }
92
92
 
93
+ /**
94
+ * Determines if two nodes or tokens have at least one whitespace character
95
+ * between them. Order does not matter. Returns false if the given nodes or
96
+ * tokens overlap.
97
+ * @param {SourceCode} sourceCode The source code object.
98
+ * @param {ASTNode|Token} first The first node or token to check between.
99
+ * @param {ASTNode|Token} second The second node or token to check between.
100
+ * @param {boolean} checkInsideOfJSXText If `true` is present, check inside of JSXText tokens for backward compatibility.
101
+ * @returns {boolean} True if there is a whitespace character between
102
+ * any of the tokens found between the two given nodes or tokens.
103
+ * @public
104
+ */
105
+ function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) {
106
+ if (nodesOrTokensOverlap(first, second)) {
107
+ return false;
108
+ }
109
+
110
+ const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0]
111
+ ? [first, second]
112
+ : [second, first];
113
+ const firstToken = sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken;
114
+ const finalToken = sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken;
115
+ let currentToken = firstToken;
116
+
117
+ while (currentToken !== finalToken) {
118
+ const nextToken = sourceCode.getTokenAfter(currentToken, { includeComments: true });
119
+
120
+ if (
121
+ currentToken.range[1] !== nextToken.range[0] ||
122
+
123
+ /*
124
+ * For backward compatibility, check speces in JSXText.
125
+ * https://github.com/eslint/eslint/issues/12614
126
+ */
127
+ (
128
+ checkInsideOfJSXText &&
129
+ nextToken !== finalToken &&
130
+ nextToken.type === "JSXText" &&
131
+ /\s/u.test(nextToken.value)
132
+ )
133
+ ) {
134
+ return true;
135
+ }
136
+
137
+ currentToken = nextToken;
138
+ }
139
+
140
+ return false;
141
+ }
142
+
93
143
  //------------------------------------------------------------------------------
94
144
  // Public Interface
95
145
  //------------------------------------------------------------------------------
@@ -433,42 +483,24 @@ class SourceCode extends TokenStore {
433
483
  * @public
434
484
  */
435
485
  isSpaceBetween(first, second) {
436
- if (nodesOrTokensOverlap(first, second)) {
437
- return false;
438
- }
439
-
440
- const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0]
441
- ? [first, second]
442
- : [second, first];
443
- const firstToken = this.getLastToken(startingNodeOrToken) || startingNodeOrToken;
444
- const finalToken = this.getFirstToken(endingNodeOrToken) || endingNodeOrToken;
445
- let currentToken = firstToken;
446
-
447
- while (currentToken !== finalToken) {
448
- const nextToken = this.getTokenAfter(currentToken, { includeComments: true });
449
-
450
- if (currentToken.range[1] !== nextToken.range[0]) {
451
- return true;
452
- }
453
-
454
- currentToken = nextToken;
455
- }
456
-
457
- return false;
486
+ return isSpaceBetween(this, first, second, false);
458
487
  }
459
488
 
460
489
  /**
461
490
  * Determines if two nodes or tokens have at least one whitespace character
462
491
  * between them. Order does not matter. Returns false if the given nodes or
463
492
  * tokens overlap.
464
- * @param {...ASTNode|Token} args The nodes or tokens to check between.
493
+ * For backward compatibility, this method returns true if there are
494
+ * `JSXText` tokens that contain whitespaces between the two.
495
+ * @param {ASTNode|Token} first The first node or token to check between.
496
+ * @param {ASTNode|Token} second The second node or token to check between.
465
497
  * @returns {boolean} True if there is a whitespace character between
466
498
  * any of the tokens found between the two given nodes or tokens.
467
499
  * @deprecated in favor of isSpaceBetween().
468
500
  * @public
469
501
  */
470
- isSpaceBetweenTokens(...args) {
471
- return this.isSpaceBetween(...args);
502
+ isSpaceBetweenTokens(first, second) {
503
+ return isSpaceBetween(this, first, second, true);
472
504
  }
473
505
 
474
506
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "6.7.1",
3
+ "version": "6.7.2",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {