eslint 4.19.0 → 4.19.1

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,11 @@
1
+ v4.19.1 - March 21, 2018
2
+
3
+ * 3ff5d11 Fix: no-invalid-regexp not understand variable for flags (fixes #10112) (#10113) (薛定谔的猫)
4
+ * abc765c Fix: object-curly-newline minProperties w/default export (fixes #10101) (#10103) (Kevin Partington)
5
+ * 6f9e155 Docs: Update ambiguous for...in example for guard-for-in (#10114) (CJ R)
6
+ * 0360cc2 Chore: Adding debug logs on successful plugin loads (#10100) (Kevin Partington)
7
+ * a717c5d Chore: Adding log at beginning of unit tests in Makefile.js (#10102) (Kevin Partington)
8
+
1
9
  v4.19.0 - March 16, 2018
2
10
 
3
11
  * 55a1593 Update: consecutive option for one-var (fixes #4680) (#9994) (薛定谔的猫)
@@ -120,6 +120,26 @@ class Plugins {
120
120
  throw pluginLoadErr;
121
121
  }
122
122
 
123
+ // This step is costly, so skip if debug is disabled
124
+ if (debug.enabled) {
125
+ const resolvedPath = require.resolve(longName);
126
+
127
+ let version = null;
128
+
129
+ try {
130
+ version = require(`${longName}/package.json`).version;
131
+ } catch (e) {
132
+
133
+ // Do nothing
134
+ }
135
+
136
+ const loadedPluginAndVersion = version
137
+ ? `${longName}@${version}`
138
+ : `${longName}, version unknown`;
139
+
140
+ debug(`Loaded plugin ${pluginName} (${loadedPluginAndVersion}) (from ${resolvedPath})`);
141
+ }
142
+
123
143
  this.define(pluginName, plugin);
124
144
  }
125
145
  }
@@ -98,20 +98,17 @@ module.exports = {
98
98
  return;
99
99
  }
100
100
  const pattern = node.arguments[0].value;
101
- let flags = "";
101
+ let flags = isString(node.arguments[1]) ? node.arguments[1].value : "";
102
102
 
103
- if (node.arguments[1]) {
104
- flags = isString(node.arguments[1]) ? node.arguments[1].value : null;
105
- if (allowedFlags) {
106
- flags = flags.replace(allowedFlags, "");
107
- }
103
+ if (allowedFlags) {
104
+ flags = flags.replace(allowedFlags, "");
108
105
  }
109
106
 
110
107
  // If flags are unknown, check both are errored or not.
111
108
  const message = validateRegExpFlags(flags) || (
112
- (flags === null)
113
- ? validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false)
114
- : validateRegExpPattern(pattern, flags.indexOf("u") !== -1)
109
+ flags
110
+ ? validateRegExpPattern(pattern, flags.indexOf("u") !== -1)
111
+ : validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false)
115
112
  );
116
113
 
117
114
  if (message) {
@@ -116,7 +116,8 @@ function areLineBreaksRequired(node, options, first, last) {
116
116
  } else {
117
117
 
118
118
  // is ImportDeclaration or ExportNamedDeclaration
119
- objectProperties = node.specifiers;
119
+ objectProperties = node.specifiers
120
+ .filter(s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier");
120
121
  }
121
122
 
122
123
  return objectProperties.length >= options.minProperties ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint",
3
- "version": "4.19.0",
3
+ "version": "4.19.1",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "bin": {