reflectiondm / vscode-npmsmartimporter

An extension for VSCode editor that provides a quick fix command that inserts import statement for undeclared variables based on common naming conventions
https://marketplace.visualstudio.com/items?itemName=reflectiondm.npmsmartimporter
MIT License
2 stars 1 forks source link

Suggestion: 'import'-configured semicolon at the EOL #2

Open selfdeceited opened 6 years ago

selfdeceited commented 6 years ago

Hey! :)

First of all - great plugin!

But IMHO it can be a bit better if plugin would have the option to generate line with or without semicolon at the end (or listen to used linter values)

Right now I see during bulb click that it always generates import * as React from 'react'; line with semicolons.

and here's my e.g. tsLint.json

{
    "extends": "tslint:recommended",
    "rules": {
        "semicolon": [true, "never"]
    }
}

so each time I generate import line my linter goes crazy & need to remove this semicolon manually. After several imports in a row, this started bumming me out a bit.

reflectiondm commented 6 years ago

Hey @selfdeceited !

Thanks for the feedback and a feature suggestion. Indeed that's a nice idea. Hard to catch all those small things when you only work with your own style guide :)

Stay tuned, this gonna be implemented in a future release.

selfdeceited commented 6 years ago

I guess I should also note some weird double/ordinary quotes behavior: usually it's using double quotes which I prefer but for some reason it's ordinary for local imports.

Here's the gif: http://g.recordit.co/vG5dDK1dw2.gif

Would you like discussing it in a (new) separate issue or it's in scope of this enhancement?

reflectiondm commented 6 years ago

@selfdeceited This one is not from my extension but from a native vscode import helper unfortunately, and as of now it does not respect linting settings. But that makes me think that I should also provide an option to chose whether to use single or double quotes for imports.