diff --git a/scripts/create-rule.js b/scripts/create-rule.js index 14b2c9c263..1228a709ec 100644 --- a/scripts/create-rule.js +++ b/scripts/create-rule.js @@ -110,10 +110,10 @@ function updateReadmeRules(data) { const RULE_START = '## Rules\n\n'; const RULE_END = '\n\n## Deprecated Rules'; let ruleContent = `- [${data.id}](docs/rules/${data.id}.md) - ${data.description}`; - if (data.isFixable === true) { - ruleContent += ' *(fixable)*'; - } else if (data.isFixable === 'partly') { + if (data.isFixable && data.isFixable.partly) { ruleContent += ' *(partly fixable)*'; + } else if (data.isFixable) { + ruleContent += ' *(fixable)*'; } const file = path.join(ROOT, 'readme.md'); @@ -178,16 +178,24 @@ function updateReadme(data) { message: 'Is it fixable?', choices: [ { - name: true, - message: 'Yes' + message: 'Code', + value: {type: 'code'} + }, + { + message: 'Code (Partly)', + value: {type: 'code', partly: true} + }, + { + message: 'Whitespace', + value: {type: 'whitespace'} }, { - name: 'partly', - message: 'Partly' + message: 'Whitespace (Partly)', + value: {type: 'whitespace', partly: true} }, { - name: false, - message: 'No' + message: 'No', + value: false } ] }, diff --git a/scripts/template/documentation.md.jst b/scripts/template/documentation.md.jst index 8994820622..096ae09b79 100644 --- a/scripts/template/documentation.md.jst +++ b/scripts/template/documentation.md.jst @@ -1,10 +1,10 @@ # <%= description %> -<% if (isFixable === true) { %> -This rule is fixable. -<% } else if (isFixable === 'partly') { %> +<% if (isFixable && isFixable.partly) { %> This rule is partly fixable. +<% } else if (isFixable) { %> +This rule is fixable. <% } %> ## Fail diff --git a/scripts/template/rule.js.jst b/scripts/template/rule.js.jst index 772d44df97..a967d8f25b 100644 --- a/scripts/template/rule.js.jst +++ b/scripts/template/rule.js.jst @@ -35,7 +35,7 @@ module.exports = { docs: { url: getDocumentationUrl(__filename) },<% if (isFixable) { %> - fixable: 'code',<% } %> + fixable: '<%= isFixable.type %>',<% } %> schema, messages }