madskristensen / WebAnalyzer

A Visual Studio extension
Other
55 stars 17 forks source link

Ability to *add* custom rules to ESLint #24

Open peter-sahajian opened 8 years ago

peter-sahajian commented 8 years ago

Hi Mads,

Awesome VS extension! I've been enjoying what it brings to VS for about a week now! However, I am having trouble taking advantage of one of ESLint's core capabilities:

Being able to add project-specific/runtime rules to the linter, my own custom rules.

I have read almost all of the ESLint documentation, and have peered through your extensions source code, and looked at the open requests and comments of this extension, but can't find an answer.

What I do know:

"rules" : {
    "for-example-rule" : 2
}

However, I obviously get an error Definition for rule 'for-example-rule' was not found because my for-example-rule.js definition file is not located in lib/rules with the rest of the ESLint rules.

What I am wondering is if your extension exposes the lib/rules location, so that users can drop in new rules to be used when linting _OR_ is there a way your extension can add a dialog/input for a absolute/relative path to a folder that contains our own custom rules, and then simply runs

eslint --rulesdir "<filepath>"

So that ESLint knows to add those runtime rules to it's validation?

In order to cement this extension as a component of my development process, I need to be able to add custom rules to lint my code against. I hope you agree that it is a worthy addition to this extension.

Thanks for the great extension, and regards!