import-js/eslint-plugin-import

Support for named aggregate export pattern in import/name

开放

#1,753 创建于 2020年5月10日

 (13 条评论) (13 个反应) (0 位负责人)JavaScript (1,549 个派生)batch import
bughelp wanted

仓库指标

星标
 (5,938 个星标)
PR 合并指标
 (平均合并 138天 22小时) (30 天内合并 3 个 PR)

描述

Apologies if this is ultimately the same bug as described in #1583 but it is a slightly different circumstance so I wanted to post it separately in case it is distinct

Given:

// constants.js
export const x = 5
export const y = 6
// index.js
export * as constants from './constants'

The following is considered invalid:

// sandbox.js
import { constants } from './index'

Error:

ESLint: constants not found in './index' (import/named)

However, the following is considered valid

// sandbox.js
import * as blah from './index'

and indeed blah.constants is populated correctly.

My configuration:

{
  "extends": "airbnb-base",
  "parser": "babel-eslint",
  "rules": {
    "semi": [2, "never"],
    "indent": [2, "tab"],
    "no-tabs": 0
  },
  "env": {
    "es6": true,
    "node": true,
    "jest": true
  }
}

Eslint version: v6.8.0

贡献者指南