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

Use a default eslint and eslintConfig #113

Closed
zeke opened this issue Jul 24, 2016 · 2 comments
Closed

Use a default eslint and eslintConfig #113

zeke opened this issue Jul 24, 2016 · 2 comments

Comments

@zeke
Copy link

zeke commented Jul 24, 2016

The linter constructor doesn't seem to work without options:

❯ trymodule standard-engine
Package 'standard-engine' was loaded and assigned to 'standard_engine' in the current scope
REPL started...
> standard_engine
{ cli: [Function: Cli], linter: [Function: Linter] }

> const standard = standard_engine.linter()
Error: opts.eslint option is required
    at new Linter (/Users/zeke/.trymodule/node_modules/standard-engine/index.js:32:27)
    at Object.Linter (/Users/zeke/.trymodule/node_modules/standard-engine/index.js:26:41)
   ...

Passing in eslint and an empty object works though:

~/forks/standard-engine master* 25s
❯ node        
> const eslint = require('.')
undefined
> const standard = require('.').linter({eslint:eslint, eslintConfig: {}})

I think a nicer behavior would be to allow the options to be undefined, defaulting to vanilla eslint if unspecified.

@Flet
Copy link
Member

Flet commented Jul 25, 2016

This seems sensible, however standard-engine isn't really meant to be run directly on its own.

Its really just the glue that connects a specific version of eslint with a specific config. The config itself drives which version of eslint is needed as rules can be added/changed every version. This also allows using other eslint implementations like babel-eslint.

@zeke
Copy link
Author

zeke commented Jul 25, 2016

Thanks, @Flet. I was a bit off-track, then realized standard has a programmatic API that suits my purposes: #114

Closing!

@zeke zeke closed this as completed Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants