-
Notifications
You must be signed in to change notification settings - Fork 142
Support for rules from eslint plugins #16
Comments
I first need an answer to eslint/eslint#1450 |
+1 Any progress so far? It's blocking me using any eslint plugins since linter-eslint crashes trying to read my |
I am sorry to say that I did not make any progress recently. For now, I have no idea of how to do it properly because of how plugins are loaded. I must think about it a bit more. |
I can imagine the difficulties: The plugins (incl. versions) are defined in a project (directory) and can't be known beforehand, so you'd have to install them when reading a project's Is there a chance you might parsing the That being said, there are currently only a handful of eslint plugins. You might want to decide to include a few of them in linter-eslint (I would certainly welcome it). |
The problem is that the config (.eslintrc) loading and merging is delegated to the eslint API to ensure a consistent behaviour with the command line. So at the moment I see the following options:
|
Sounds like the best option for now would be option 2, i.e. adding a silent error option to eslint. From a quick code search, it looks like this else branch is all that needs to change for missing rule errors to be silent. Wait—you wrote that "loading and merging is delegated to the eslint API". But that just means that you retrieve the config from eslint, to then pass that config object to # Line 43
config = engine.getConfigForFile(origPath)
config.plugins = _.omit(config.rules, (val, key) -> _.contains(key, '/'))
result = linter.verify @editor.getText(), config
# ... If I'm not mistaken, this is all you need to remove plugin-based rules. |
You are right. I think this is the best option at the moment. Would you mind submitting a PR ? |
Sure thing: #18 |
See AtomLinter#16 for more discussion.
See AtomLinter#16 for more discussion.
Should not break anymore but real plugin support would be cool. |
Hello,
I am having an issue with loading rules from external eslint plugins. I am trying to load get the linter working with "eslint-plugin-openui5" but get an error that the definition for the rule is not found.
This is how we the plugin is loaded:
"plugins": [
"eslint-plugin-openui5"
],
"rules": {
"openui5/line-endings": 2,
}
I would really appreciate some help in fixing this problem.
Thanks
The text was updated successfully, but these errors were encountered: