import-js/eslint-plugin-import

[import/default]: false negative when importing CJS module which uses dynamic import

Open

#2,769 建立於 2023年4月27日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)JavaScript (1,540 fork)batch import
help wanted

倉庫指標

Star
 (4,946 star)
PR 合併指標
 (平均合併 138天 22小時) (30 天內合併 3 個 PR)

描述

I found a weird problem with the import/default rule. See this minimal gist

I import two modules which are very similar, both being CJS with default export.

import ecmaScriptLiteralLoader from 'rdf-loader-code/ecmaScriptLiteral.js'
import ecmaScriptModuleLoader from 'rdf-loader-code/ecmaScriptModule.js'

The first is fine but the second triggers a rule

3:8  error  No default export found in imported module "rdf-loader-code/ecmaScriptModule.js"  import/default

貢獻者指南