From fadad0b5cf786b3186d74a35d9933b5e8bea0e34 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Mon, 16 Mar 2026 14:29:30 +0000 Subject: [PATCH] Ignore export const case --- .changes/fix-export-const.md | 5 +++++ packages/eslint-plugin-prefer-let/lib/rules/prefer-let.js | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changes/fix-export-const.md 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({