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

Add JavaScript Standard Style (`standard`) as a linter option #507

Closed
galenandrew opened this issue Jan 4, 2016 · 10 comments
Assignees
Labels
Milestone

Comments

@galenandrew
Copy link

@galenandrew galenandrew commented Jan 4, 2016

Would love to see standard as a linter option.

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Jan 4, 2016

I don't think that's appropriate as a built-in option. hapi has a very specific style which we apply throughout the project.

@hueniverse hueniverse added the request label Jan 4, 2016
@galenandrew

This comment has been minimized.

Copy link
Author

@galenandrew galenandrew commented Jan 4, 2016

I'm referring to the --linter CLI option for Lab. You have eslint and jslint in lib/linters so it appears to be designed in a way to support multiple linters. Am I incorrect?

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Jan 4, 2016

It is, just not sure we want to bundle lab with another.

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Jan 5, 2016

@galenandrew I was looking into that a while back, but opted to just use an eslint config file to extend: 'standard'. I want to move in the direction of removing jslint from lab, especially since we don't use it for any hapi projects.

We do support passing options directly to eslint from the --lint-options argument. But I am not seeing any way to specify an eslint plugin: http://eslint.org/docs/developer-guide/nodejs-api.html#cliengine

For example, if you want to run a single rule you can run lab like:

lab --lint-options '{ "rules": { "comma-dangle": [1, "never"]} }'
@galenandrew

This comment has been minimized.

Copy link
Author

@galenandrew galenandrew commented Jan 5, 2016

Thank you for the very helpful comment @geek! The eslint config and --lint-options are definitely a good workaround!!

@hueniverse, I'm picking up on a sense that this project is maintained only for use in other Hapi projects. If you choose to close this issue because it won't be used in other Hapi projects that is fine; the eslint alternative gets the job done.

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Jan 6, 2016

lab represents the "hapi way" of doing things. I don't maintain this, @geek does.

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Jan 6, 2016

@galenandrew I know others who want to see support for belly button, and I wouldn't mind seeing our seneca style as a built-in option... the default would stay with the hapi style guide.

Going to keep this issue open for now

@galenandrew

This comment has been minimized.

Copy link
Author

@galenandrew galenandrew commented Jan 7, 2016

@geek sounds good

@geek geek added this to the 9.0.0 milestone Feb 18, 2016
@geek geek self-assigned this Feb 18, 2016
@geek geek closed this in #522 Feb 18, 2016
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Feb 18, 2016

@galenandrew added the ability to use a custom linter in lab, this will allow standard to be wrapped and used... just need to return our custom lint report format: https://github.com/hapijs/lab/blob/master/lib/linter/index.js#L43-L56

@galenandrew

This comment has been minimized.

Copy link
Author

@galenandrew galenandrew commented Feb 19, 2016

Awesome! Thank you for the update @geek!! 🤘

@Marsup Marsup added feature and removed request labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.