Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local plugins #1651

Closed
boneskull opened this issue Jan 11, 2015 · 5 comments
Closed

local plugins #1651

boneskull opened this issue Jan 11, 2015 · 5 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features triage An ESLint team member will look at this issue soon

Comments

@boneskull
Copy link

This ticket references an "open issue" mentioned in #1106.

Since #1386 was closed, if you:

  • Want to write a plugin or rule, and
  • Don't want to publish it to NPM, and
  • Are using eslint in a non-CLI context, then
  • Your tool/IDE must explicitly support the --rulesdir CLI option, or
  • You are SOL.

Which happens to be the situation I'm in right now. 😄

I'm using ESLint from a JetBrains IDE (which provides ESLint errors/warnings in context), and it simply reads a specific config file--it has no options for flags. I imagine this is the case in many other tools as well.

I want to write a custom plugin, but don't want to bother with publishing to NPM. I wanted to bang something out, but since I can't specify a rulesdir from my config file, I don't think I have any recourse.

@lo1tuma lo1tuma added triage An ESLint team member will look at this issue soon core Relates to ESLint's core APIs and features labels Jan 11, 2015
@lo1tuma
Copy link
Member

lo1tuma commented Jan 11, 2015

You can install your local plugin with npm and without publishing it to the public registry:

npm install /local-path/to/your/custom-plugin

npm link would work too.

@nzakas nzakas closed this as completed Jan 17, 2015
@boneskull
Copy link
Author

@lo1tuma So I'd have to do something like have project dir "foo" and "foo/my-plugin" then "npm --save-dev my-plugin" from "foo"?? Does npm allow that? Seems pretty weird, if not bad/evil.

@nzakas I don't see what the resistance is to making this a bit easier for users, unless it's difficult to implement or would be a maintenance burden. Plugins are cool and all, but unless you can give your config a path to a plugin (not just a module name) it makes them a bit awkward for specific requirements.

@lo1tuma
Copy link
Member

lo1tuma commented Jan 19, 2015

@boneskull You have to run npm install ./my-plugin from foo/. Local paths within your package.json works since npm v2.0.0.

@nzakas
Copy link
Member

nzakas commented Jan 19, 2015

I think it's reasonable to limit the number of ways to do the same thing. --rulesdir was a quick hack to get runtime rules support until we got plugins.

There's already a way to load local plugins, so it appears your use case is already solved.

@boneskull
Copy link
Author

Well, if you can npm install a subdirectory, then I'll do that.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants