This repository has been archived by the owner on Aug 4, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated rules to new format, added deprecated flag (#119)
- Loading branch information
1 parent
be8d95c
commit 08d35b3
Showing
6 changed files
with
158 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}; | ||
} | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
}; | ||
} | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'], | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'] | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
}; | ||
} | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'] | ||
} | ||
]; |