babel/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js
Kai Cataldo 7f732ad019 Clean up @babel/eslint-plugin (#10756)
* Clean up @babel/eslint-plugin

* Add directory field to package.json

* Update eslint/babel-eslint-plugin/README.md

Co-Authored-By: Huáng Jùnliàng <jlhwung@gmail.com>

* Incorporate feedback :)
2019-11-25 17:15:34 -05:00

46 lines
910 B
JavaScript

let isWarnedForDeprecation = false;
export default {
meta: {
deprecated: true,
schema: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
singleValue: {
type: "boolean",
},
objectsInArrays: {
type: "boolean",
},
arraysInArrays: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
create() {
return {
Program() {
if (
isWarnedForDeprecation ||
/=-(f|-format)=/.test(process.argv.join("="))
) {
return;
}
console.log(
"The babel/array-bracket-spacing rule is deprecated. Please " +
"use the built in array-bracket-spacing rule instead.",
);
isWarnedForDeprecation = true;
},
};
},
};