Skip to content

Commit

Permalink
[Tests] add no-named-as-default test for #1594
Browse files Browse the repository at this point in the history
  • Loading branch information
akwodkiewicz committed Aug 31, 2024
1 parent 32a2b89 commit 53f46a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/files/no-named-as-default/dual-export/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { something as default } from "./something";
export { something } from "./something";
1 change: 1 addition & 0 deletions tests/files/no-named-as-default/dual-export/something.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const something = 42;
6 changes: 6 additions & 0 deletions tests/src/rules/no-named-as-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ ruleTester.run('no-named-as-default', rule, {
parserOptions: { ecmaVersion: 2022 },
})),

// #1594: Allow importing as default if object is exported both as default and named
test({ code: 'import something from "./no-named-as-default/dual-export";' }),
test({
code: 'import { something } from "./no-named-as-default/dual-export";',
}),

...SYNTAX_CASES,
),

Expand Down

0 comments on commit 53f46a9

Please sign in to comment.