Skip to content

Commit

Permalink
test(linter): add regression tests for import/namespace (#7723)
Browse files Browse the repository at this point in the history
Related to #7696
  • Loading branch information
shulaoda authored Dec 8, 2024
1 parent 37709ce commit 02f9903
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions crates/oxc_linter/fixtures/import/node_modules/acorn/acorn.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions crates/oxc_linter/fixtures/import/node_modules/acorn/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/oxc_linter/fixtures/import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@org/package": "^1.0.0",
"acorn": "^1.0.0",
"esm-package": "^1.0.0",
"jquery": "^3.1.0",
"lodash.cond": "^4.3.0",
Expand Down
2 changes: 2 additions & 0 deletions crates/oxc_linter/src/rules/import/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ fn test() {
(r#"import * as a from "./deep-es7/a"; var {b:{c:{d:{e}}}} = a"#, None),
(r#"import { b } from "./deep-es7/a"; var {c:{d:{e}}} = b"#, None),
(r"import { a } from './oxc/indirect-export'; console.log(a.nothing)", None),
// Issue: <https://github.com/oxc-project/oxc/issues/7696>
(r"import * as acorn from 'acorn'; acorn.parse()", None),
];

let fail = vec![
Expand Down

0 comments on commit 02f9903

Please sign in to comment.