Files
med-notes/.pnpm-store/v10/files/ef/03b4881d6f8adb0bdb9f837d680a154f9a4a589126ea25aab57b8c02a45b4d42e8a683064908135df0e2e1fbaa45a45a540726aa2fd5b0f8952c79e35c343c
2025-05-09 05:30:08 +02:00

38 lines
753 B
Plaintext

/**
* @fileoverview Rule to flag use of with statement
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow `with` statements",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-with",
},
schema: [],
messages: {
unexpectedWith: "Unexpected use of 'with' statement.",
},
},
create(context) {
return {
WithStatement(node) {
context.report({ node, messageId: "unexpectedWith" });
},
};
},
};