sindresorhus / grunt-eslint

Validate files with ESLint
MIT License
200 stars 72 forks source link

Add support for extends #163

Closed ghost closed 5 years ago

ghost commented 5 years ago

Closes #160 image https://eslint.org/docs/developer-guide/nodejs-api


IssueHunt Summary ### Referenced issues This pull request has been submitted to: - [#160: Add support for extends](https://issuehunt.io/repos/11402746/issues/160) --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)
sindresorhus commented 5 years ago

It should be exposed as extends option, not baseConfig.extends.

ghost commented 5 years ago

@sindresorhus If desired, all of the baseConfig options can be hoisted by using ESLint's config schema: https://github.com/sindresorhus/grunt-eslint/compare/master...pro-src:hoist_base_config?expand=1 https://github.com/eslint/eslint/blob/master/conf/config-schema.js

And maybe fail hard if an unrecognized option is specified.

ghost commented 5 years ago

@sindresorhus,

I know you have 1k other PRs to like at that are far more interesting but I'm bored so I'm going to bug you anyway. :stuck_out_tongue_winking_eye:

I'm wondering if you had something else in mind for this PR. As the the issue title is confusing to me. Simply because there is already support for the "extends" option. I get what you mean by it should be exposed as "extends" but it has already been exposed as "extends" by ESLint though nested under the documented baseConfig option. I've taken a guess at what the expectation is for this, made changes, and made some suggestions. So, I don't really know what else to do with it. Also, If you just didn't realize that it was already exposed, feel free to kick this out of limbo and into the trash. I don't mind. :smile:

Thanks

sindresorhus commented 5 years ago

Nah, the point is to just make the extends option more discoverable and easier to use by making it top-level and documenting it.

--

I get what you mean by it should be exposed as "extends" but it has already been exposed as "extends" by ESLint though nested under the documented baseConfig option.

Yes, but it's not discoverable.

ghost commented 5 years ago

@kevva Thanks for the review. Did you notice https://github.com/sindresorhus/grunt-eslint/compare/master...pro-src:hoist_base_config?expand=1 ?

It uses the rest operator :+1: