Skip to content

Commit

Permalink
fix: Allow for misconfigured default exports (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
scagood committed Jun 5, 2024
1 parent 0efe751 commit 92e18b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"enhanced-resolve": "^5.15.0",
"enhanced-resolve": "^5.17.0",
"eslint-plugin-es-x": "^7.5.0",
"get-tsconfig": "^4.7.0",
"globals": "^15.0.0",
Expand Down
23 changes: 8 additions & 15 deletions tests/lib/rules/no-missing-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ ruleTester.run("no-missing-import", rule, {
code: "import a from './e.jsx';",
},

{
filename: fixture("test.js"),
code: "import 'misconfigured-default';",
},

// tryExtensions
{
filename: fixture("test.js"),
Expand Down Expand Up @@ -350,7 +355,9 @@ ruleTester.run("no-missing-import", rule, {
resolveError: [
"Package path ./sub.mjs is not exported from package",
fixture("node_modules/esm-module"),
`(see exports field in ${fixture("node_modules/esm-module/package.json")})`,
`(see exports field in ${fixture(
"node_modules/esm-module/package.json"
)})`,
].join(" "),
},
},
Expand Down Expand Up @@ -435,20 +442,6 @@ ruleTester.run("no-missing-import", rule, {
skip: !isCaseSensitiveFileSystem,
},

{
filename: fixture("test.js"),
code: "import 'misconfigured-default';",
errors: [
{
messageId: "notFound",
data: {
name: "misconfigured-default",
resolveError: "Default condition should be last one",
},
},
],
},

// import()
...(DynamicImportSupported
? [
Expand Down

0 comments on commit 92e18b5

Please sign in to comment.