streetsidesoftware / vscode-spell-checker

A simple source code spell checker for code
https://streetsidesoftware.github.io/vscode-spell-checker/
Other
1.43k stars 128 forks source link

Should not check module name in require lines. #314

Open xpol opened 5 years ago

xpol commented 5 years ago

What

import shouldCheck from "shouldNotCheck"
const shouldCheckToo = require("shouldNotCheckToo")

The shouldNotCheck and shouldNotCheckToo should not checked by vscode-spell-checker.

Why

Package names may be not have valid spells. eg antd

But they may widely used in whole project. To disable them manually is not necessary.

Jason3S commented 5 years ago

I fully agree with you that it should not spell check imports.

I am working on a way to do this, but it will take some time.

OmgImAlexis commented 5 years ago

@Jason3S is there a regex we could use for now until a proper workaround is added?

OmgImAlexis commented 5 years ago

I'm thinking something like this might work?

// cSpell:ignoreRegExp (?:from (?:'|")([A-Za-z0-9-_\/\.\@]*)(?:'|"))|(?:require\((?:'|")([A-Za-z0-9-_\/\.\@]*)(?:'|")\)) -- ignore node's import/require
import shouldCheck from "shouldNotCheck"
const shouldCheckToo = require("shouldNotCheckToo")