Skip to content

Declare a JSON schema in 'default' for each rule #222

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

Closed
wants to merge 4 commits into from

Conversation

Manu1400
Copy link

@Manu1400 Manu1400 commented Mar 25, 2019

For fix #214 :

  • each rule have a JSON schema

@sindresorhus
Copy link
Member

Bump :)

@Manu1400
Copy link
Author

this PR is ready

const create = context => {
const ava = createAvaRule();
const maxAssertions = context.options[0] || 5;
const maxAssertions = context.options[0] || MAX_NUMBER_ASSERTIONS_BY_DEFAULT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you defining the default both here and in the schema?

@@ -94,6 +105,7 @@ module.exports = {
docs: {
url: util.getDocsUrl(__filename)
},
type: 'problem',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be placed above docs. Same with the other places.

@@ -141,14 +141,16 @@ const schema = [{
enum: [
'always',
'never'
]
],
default: null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined would be better

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

Successfully merging this pull request may close these issues.

Use JSON schema default in rules
2 participants