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

Support eslint plugins / standard style #5

Open
letmaik opened this issue Oct 5, 2015 · 5 comments
Open

Support eslint plugins / standard style #5

letmaik opened this issue Oct 5, 2015 · 5 comments

Comments

@letmaik
Copy link

letmaik commented Oct 5, 2015

I use the eslint.json from https://github.com/feross/eslint-config-standard and when I run that in tern.java it outputs the error "[ESLint]: Definition for rule 'standard/object-curly-even-spacing' was not found" at the first code lint. This is problem because the eslint.json has this:

  "plugins": [
    "standard"
  ],

I'm not sure how this whole scenario can be supported but in the end I just want to use standard style. It would be quite cool if this could be directly integrated somehow since it is so popular. Like a dropdown of some common popular code styles.

@angelozerr
Copy link
Owner

@neothemachine could you give me more info please. I don't know very good eslint.

I have created an eslint.json like this:

{
  "plugins": [
    "standard"
  ]
}

and I have setted as configFiel with tern.java. I have none errors like yours "[ESLint]: Definition for rule 'standard/object-curly-even-spacing' ?

@letmaik
Copy link
Author

letmaik commented Oct 5, 2015

Sorry this was not the full content. Please use this: https://github.com/feross/eslint-config-standard/blob/master/eslintrc.json

angelozerr added a commit that referenced this issue Oct 5, 2015
angelozerr added a commit to angelozerr/tern.java that referenced this issue Oct 5, 2015
@angelozerr
Copy link
Owner

@neothemachine I have add loadPlugins inside eslint coming from the ESLint cli-engine. Once the build https://opensagres.ci.cloudbees.com/job/tern.java/750/ is done. You will able to test it.

You must install eslint-plugin-standard in a global or inside ternjs folder (see tern repository that you can find in Tern -> Development -> Repository)

@letmaik
Copy link
Author

letmaik commented Oct 5, 2015

Cool, that works! I installed it with "npm install eslint-plugin-standard" inside the ternjs folder, though I guess a global install makes more sense since the folder will be different on each update and I would have to do it again. I tried the global install, but then in eclipse it didn't find it:

Error: Cannot find module 'eslint-plugin-standard'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at ...\plugins\ternjs_1.1.0.201510051730\node_modules\tern-eslint\eslint.js:228:28
    at Array.forEach (native)
    at loadPlugins (...\plugins\ternjs_1.1.0.201510051730\node_modules\tern-eslint\eslint.js:219:23)
    at validate (...\plugins\ternjs_1.1.0.201510051730\node_modules\tern-eslint\eslint.js:313:2)
    at Object.tern.defineQueryType.run (...\plugins\ternjs_1.1.0.201510051730\node_modules\tern-eslint\eslint.js:325:9)
    at run (...\plugins\ternjs_1.1.0.201510051730\node_modules\tern\lib\tern.js:254:30)
    at require (module.js:384:17)

Not sure what's going on there or how I could debug that. Does a global install work for you?

@angelozerr
Copy link
Owner

Not sure what's going on there or how I could debug that. Does a global install work for you?

to be honnest with you I have not tested that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants