Urara-Blog/node_modules/.pnpm-store/v3/files/51/c5dcbdfea4bb9d0251abf1828e3bcfbecca3803b2946966ac22c4510f5e6d517744a3b694770491681aed26210a267a695c909a51b3facf63599242fe03495
2022-08-14 01:14:53 +08:00

41 lines
882 B
Text

/**
* @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,
url: "https://eslint.org/docs/rules/no-ternary"
},
schema: [],
messages: {
noTernaryOperator: "Ternary operator used."
}
},
create(context) {
return {
ConditionalExpression(node) {
context.report({ node, messageId: "noTernaryOperator" });
}
};
}
};