diff --git a/rules/assertion-arguments.js b/rules/assertion-arguments.js index c7019a06..bbe006c1 100644 --- a/rules/assertion-arguments.js +++ b/rules/assertion-arguments.js @@ -141,7 +141,8 @@ const schema = [{ enum: [ 'always', 'never' - ] + ], + default: undefined } } }]; diff --git a/rules/max-asserts.js b/rules/max-asserts.js index 1fee403a..4dedc291 100644 --- a/rules/max-asserts.js +++ b/rules/max-asserts.js @@ -3,11 +3,15 @@ const {visitIf} = require('enhance-visitors'); const util = require('../util'); const createAvaRule = require('../create-ava-rule'); +const MAX_ASSERTIONS_DEFAULT = 5; + const notAssertionMethods = ['plan', 'end']; const create = context => { const ava = createAvaRule(); - const maxAssertions = context.options[0] || 5; + // TODO: Convert options to object JSON Schema default works properly + // https://github.com/avajs/eslint-plugin-ava/issues/260 + const maxAssertions = context.options[0] || MAX_ASSERTIONS_DEFAULT; let assertionCount = 0; let nodeToReport; @@ -55,9 +59,12 @@ const create = context => { }); }; -const schema = [{ - type: 'integer' -}]; +const schema = [ + { + type: 'integer', + default: MAX_ASSERTIONS_DEFAULT + } +]; module.exports = { create, diff --git a/rules/test-title-format.js b/rules/test-title-format.js index dcadc373..756274cd 100644 --- a/rules/test-title-format.js +++ b/rules/test-title-format.js @@ -35,12 +35,25 @@ const create = context => { }); }; +const schema = [ + { + type: 'object', + properties: { + format: { + type: 'string', + default: undefined + } + } + } +]; + module.exports = { create, meta: { type: 'suggestion', docs: { url: util.getDocsUrl(__filename) - } + }, + schema } };