diff --git a/.changes/fix-export-const.md b/.changes/fix-export-const.md new file mode 100644 index 0000000..6de4fce --- /dev/null +++ b/.changes/fix-export-const.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-prefer-let": patch +--- + +Ignore `export const` cases diff --git a/packages/eslint-plugin-prefer-let/lib/rules/prefer-let.js b/packages/eslint-plugin-prefer-let/lib/rules/prefer-let.js index 41349e8..f9559cf 100644 --- a/packages/eslint-plugin-prefer-let/lib/rules/prefer-let.js +++ b/packages/eslint-plugin-prefer-let/lib/rules/prefer-let.js @@ -132,6 +132,8 @@ module.exports = { } }); } + } else if (node.parent && node.parent.type === 'ExportNamedDeclaration') { + // ignore `export const` cases } else { let constToken = sourceCode.getFirstToken(node); context.report({