avajs / eslint-plugin-ava

ESLint rules for AVA
https://avajs.dev
MIT License
230 stars 49 forks source link

Add defaults to schema #258

Closed MrHen closed 5 years ago

MrHen commented 5 years ago

Fixes #214.

Honestly, I'm not sure this issue makes a lot of sense. There were only three rules I saw that had options at all:

Am I missing something about this request? There was no Object.assign usage to replace.

GMartigny commented 5 years ago

I opened an issue to eslint reporting this. It's working as designed for now. Either we complain to ajv to add this behavior or we "convert from the numeric option to an object which would then pick up the default" as you said.

sindresorhus commented 5 years ago

Alternatively, set the default in schema but also use the fallback in create.

👍 With a TODO comment about removing the fallback in the next major version.

MrHen commented 5 years ago

@sindresorhus I think I got it right this time? Although now I'm thinking I should just file an Issue for it and include a link in the TODO comment. 😛

sindresorhus commented 5 years ago

Although now I'm thinking I should just file an Issue for it and include a link in the TODO comment.

👍

sindresorhus commented 5 years ago

@MrHen Can you submit the PR URL here: https://issuehunt.io/r/avajs/eslint-plugin-ava/issues/214 ?

MrHen commented 5 years ago

@sindresorhus Done. Sorry, I keep forgetting it isn't automatic.