diff --git a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js index a7da50b785..0a9ba37521 100644 --- a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js @@ -1,39 +1,43 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "singleValue": { + "type": "boolean" + }, + "objectsInArrays": { + "type": "boolean" + }, + "arraysInArrays": { + "type": "boolean" + } + }, + "additionalProperties": false } - - /* eslint-disable no-console */ - console.log('The babel/array-bracket-spacing rule is deprecated. Please ' + - 'use the built in array-bracket-spacing rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] + ] }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } + + /* eslint-disable no-console */ + console.log('The babel/array-bracket-spacing rule is deprecated. Please ' + + 'use the built in array-bracket-spacing rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; } - }, - "additionalProperties": false + }; } -]; +}; diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js index 03f50dcfd0..13d9c8ffe0 100644 --- a/eslint/babel-eslint-plugin/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -1,24 +1,28 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "as-needed"] } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/arrow-parens rule is deprecated. Please ' + - 'use the built in arrow-parens rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "as-needed"] + /* eslint-disable no-console */ + console.log('The babel/arrow-parens rule is deprecated. Please ' + + 'use the built in arrow-parens rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; } -]; +}; diff --git a/eslint/babel-eslint-plugin/rules/flow-object-type.js b/eslint/babel-eslint-plugin/rules/flow-object-type.js index 530efb8d65..73cd3ed17a 100644 --- a/eslint/babel-eslint-plugin/rules/flow-object-type.js +++ b/eslint/babel-eslint-plugin/rules/flow-object-type.js @@ -1,25 +1,29 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["semicolon", "comma"], } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/flow-object-type rule is deprecated. Please ' + - 'use the flowtype/object-type-delimiter rule instead.\n' + - 'Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; + /* eslint-disable no-console */ + console.log('The babel/flow-object-type rule is deprecated. Please ' + + 'use the flowtype/object-type-delimiter rule instead.\n' + + 'Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports.schema = [ - { - 'enum': ['semicolon', 'comma'], - } -]; diff --git a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js index bf5c1eee5c..0290d81323 100644 --- a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js @@ -1,24 +1,28 @@ 'use strict'; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "always-multiline", "only-multiline", "never"] } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/func-params-comma-dangle rule is deprecated. Please ' + - 'use the built in comma-dangle rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; + /* eslint-disable no-console */ + console.log('The babel/func-params-comma-dangle rule is deprecated. Please ' + + 'use the built in comma-dangle rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports.schema = [ - { - enum: ['always', 'always-multiline', 'only-multiline', 'never'] - } -]; diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js index 38d586c6e3..64186ffe68 100644 --- a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js @@ -1,36 +1,40 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } - - /* eslint-disable no-console */ - console.log('The babel/generator-star-spacing rule is deprecated. Please ' + - 'use the built in generator-star-spacing rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; -}; - -module.exports.schema = [ - { - "oneOf": [ +module.exports = { + meta: { + deprecated: true, + schema: [ { - "enum": ["before", "after", "both", "neither"] - }, - { - "type": "object", - "properties": { - "before": {"type": "boolean"}, - "after": {"type": "boolean"} - }, - "additionalProperties": false + "oneOf": [ + { + "enum": ["before", "after", "both", "neither"] + }, + { + "type": "object", + "properties": { + "before": {"type": "boolean"}, + "after": {"type": "boolean"} + }, + "additionalProperties": false + } + ] } ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } + + /* eslint-disable no-console */ + console.log('The babel/generator-star-spacing rule is deprecated. Please ' + + 'use the built in generator-star-spacing rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; } -]; +}; diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/rules/object-shorthand.js index eaf24a1803..73ce1365ba 100644 --- a/eslint/babel-eslint-plugin/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/rules/object-shorthand.js @@ -1,24 +1,28 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "methods", "properties", "never"] } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/object-shorthand rule is deprecated. Please ' + - 'use the built in object-shorthand rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; + /* eslint-disable no-console */ + console.log('The babel/object-shorthand rule is deprecated. Please ' + + 'use the built in object-shorthand rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports.schema = [ - { - 'enum': ['always', 'methods', 'properties', 'never'] - } -];