eslint-plugin-prefer-let 4.2.0 → 4.2.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 +8 -0
- package/lib/rules/prefer-let.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# eslint-plugin-prefer-let
|
|
2
2
|
|
|
3
|
+
## \[4.2.2]
|
|
4
|
+
|
|
5
|
+
- [`96078a2`](https://github.com/thefrontside/javascript/commit/96078a2e1171c94150a366b30c419d38cfd64eb3) Fix ignoring `export const` cases
|
|
6
|
+
|
|
7
|
+
## \[4.2.1]
|
|
8
|
+
|
|
9
|
+
- [`fadad0b`](https://github.com/thefrontside/javascript/commit/fadad0b5cf786b3186d74a35d9933b5e8bea0e34) Ignore `export const` cases
|
|
10
|
+
|
|
3
11
|
## \[4.2.0]
|
|
4
12
|
|
|
5
13
|
- [`9066434`](https://github.com/thefrontside/javascript/commit/90664342144bce7d4a13812e82c155ba3d4ea7e0) Add `forceUpperCaseConst` option
|
package/lib/rules/prefer-let.js
CHANGED
|
@@ -122,7 +122,7 @@ module.exports = {
|
|
|
122
122
|
});
|
|
123
123
|
} else if (node.kind === 'const') {
|
|
124
124
|
if (isTopLevelScope(node)) {
|
|
125
|
-
if (forceUpperCaseConst && !allDeclaratorsUpperCase(node)) {
|
|
125
|
+
if (forceUpperCaseConst && !allDeclaratorsUpperCase(node) && !(node.parent && node.parent.type === 'ExportNamedDeclaration')) {
|
|
126
126
|
let constToken = sourceCode.getFirstToken(node);
|
|
127
127
|
context.report({
|
|
128
128
|
message: '`const` declaration for non-constant names at top-level scope. Use `let` or rename to UPPER_CASE',
|
|
@@ -132,6 +132,8 @@ module.exports = {
|
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
+
} else if (node.parent && node.parent.type === 'ExportNamedDeclaration') {
|
|
136
|
+
// ignore `export const` cases
|
|
135
137
|
} else {
|
|
136
138
|
let constToken = sourceCode.getFirstToken(node);
|
|
137
139
|
context.report({
|