Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

misnamed-import warning for import A from '.' #378

Closed
@devdoomari

Description

@devdoomari

Here's a somewhat edge-case example of what I've stumbled on:

// file path: <proj-path>/src/Logger/utils.ts
import Logger, {
  LogItem,
} from '.'; //this refers to <proj-path>/src/Logger/index.ts

Here's what I get:

error: Logger/logger.utils.ts
severity: 'Error'
message: 'Misnamed import. Import should be named '.' but found 'Logger' (import-name)'
at: '2,1'
source: 'tslint'

I wrote a tslint issue on this(palantir/tslint#2878) but was told to write the issue here.

ps: I can do a walk-around using:

import {
  default as Logger,
  ...
} from '.';

but I don't like doing tricks to please Mr Linter :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: EasySomeone with little to no experience in TSLint should be able to send a pull request for this issue.Good First Issue 🙌Howdy, neighbor!Status: Accepting PRsType: Rule FeatureAdding a feature to an existing rule.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions