cspell icon indicating copy to clipboard operation
cspell copied to clipboard

ignore JS/TS import names

Open ismail-codinglab opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. so every dependency is a fancy word

import { OneModule } from "ciflx";
import { OneModule } from "sof2o11";

All these imports can be ignored for typos

Describe the solution you'd like Detect if the line is something like import * from "*", then automatically ignore

ismail-codinglab avatar Feb 19 '21 13:02 ismail-codinglab

I agree that this would be useful.

I just have not come up with a good language agnostic way to do it.

Jason3S avatar Feb 19 '21 16:02 Jason3S

Most languages do have identical patterns:

  1. it starts at the top
  2. it's either import, use or include

I don't think you need 100% coverage. If 90% of the users code in C#, Java, C++ or TypeScript, than that would be a great impact that can be benefited already. Instead of using 10x more time just to cover up that 10% of edge cases

ismail-codinglab avatar Feb 19 '21 16:02 ismail-codinglab

@ismail-codinglab ,

The new @cspell/eslint-plugin - npm will do most of what you ask.

It does support:

import { muahahaha } from 'external-lib';

muahahaha('express twisted glee');

But it doesn't yet support:

import { SomeEnum } from `external-lib`;

const myValue = SomeEnum.UnknownWordWhatTriggersCodeSpellMuahahaha;

Jason3S avatar Mar 12 '22 06:03 Jason3S

The new @cspell/eslint-plugin - npm now supports:

import { SomeEnum } from `external-lib`;

const myValue = SomeEnum.UnknownWordWhatTriggersCodeSpellMuahahaha;

Work is being done to support this outside of ESLint.

Jason3S avatar Apr 12 '22 10:04 Jason3S