import-js/eslint-plugin-import

`namespaces` rule doesn't respect scopes

Open

#1,167 建立於 2018年9月10日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (4,946 star) (1,540 fork)batch import
bughelp wanted

描述

repro:

import React from 'react'
import * as wizards from './wizards'

// `wizards` redefined in local scope
function ComponentX({ wizards, submitWizard }) {
  return (
    <div>
      { shouldShowWizard && !isEmpty(wizards)
        // unable to validate computed reference report here at `wizards[0]`
        ? <WizardZero {...wizards[0]} onSubmit={submitWizard} /> 
        : <WhateverElse />
      }
    </div>
  )
}

pretty corner-y case but just making a note

貢獻者指南

`namespaces` rule doesn't respect scopes · import-js/eslint-plugin-import#1167 | Good First Issue