babel/eslint/babel-eslint-plugin/rules/generator-star-spacing.js
Nicolò Ribaudo b4c42601d1
Fix linting in ESLint packages (#10712)
* Lint eslint/*

* Run "make fix-js"

* Fix remaining problems

* Remove linting from subpackages

* Remove husky

* Add back eslint dep
2019-11-14 22:05:26 +01:00

44 lines
924 B
JavaScript

"use strict";
let isWarnedForDeprecation = false;
module.exports = {
meta: {
deprecated: true,
schema: [
{
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;
}
console.log(
"The babel/generator-star-spacing rule is deprecated. Please " +
"use the built in generator-star-spacing rule instead."
);
isWarnedForDeprecation = true;
},
};
},
};