nixos/home/ags/node_modules/eslint-plugin-es-x/lib/rules/no-labelled-function-declarations.js
2024-06-13 00:09:21 +02:00

26 lines
754 B
JavaScript

"use strict"
module.exports = {
meta: {
docs: {
description: "disallow labelled function declarations.",
category: "legacy",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-labelled-function-declarations.html",
},
fixable: null,
messages: {
forbidden:
"Annex B feature the labelled function declarations are forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"LabeledStatement > FunctionDeclaration.body"(node) {
context.report({ node: node.parent, messageId: "forbidden" })
},
}
},
}