Files
med-notes/.pnpm-store/v10/files/31/33897033c4e00892dff084c620752a9f42d8ed298032a3f17d2b3327e804b9d8a5c38e06037d0ec7f139dffebe547534c614f6c4e8e21a29f8aa178bf89fdf
2025-05-09 05:30:08 +02:00

39 lines
781 B
Plaintext

/**
* @fileoverview Rule to flag use of ternary operators.
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow ternary operators",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-ternary",
},
schema: [],
messages: {
noTernaryOperator: "Ternary operator used.",
},
},
create(context) {
return {
ConditionalExpression(node) {
context.report({ node, messageId: "noTernaryOperator" });
},
};
},
};