Skip to content

Commit

Permalink
fix: pure notation with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 authored and lukastaegert committed Jan 19, 2024
1 parent 463fa1f commit 96f0d1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/rules/no-side-effects-in-initialization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,7 @@ describe(
'import {/* tree-shaking no-side-effects-when-called */ x} from "import-no-effects"; x()',
'import {x as /* tree-shaking no-side-effects-when-called */ y} from "import-no-effects"; y()',
'import {x} from "import"; /*@__PURE__*/ x()',
'import {x} from "import"; /* @__PURE__ */ x()',
],
invalid: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const hasPureNotation = (node: Node, context: Rule.RuleContext) => {
const lastComment = leadingComments[leadingComments.length - 1].value;

// https://rollupjs.org/configuration-options/#treeshake-annotations
if (["@__PURE__", "#__PURE__"].includes(lastComment)) {
if (["@__PURE__", "#__PURE__"].includes(lastComment.trim())) {
return true;
}
}
Expand Down

0 comments on commit 96f0d1c

Please sign in to comment.