Sha256: 6e8f3644a2ab31aa2314cc09951ef31b0f7d922a6e3ecf8735e118c6b9624f6a
Contents?: true
Size: 957 Bytes
Versions: 43
Compression:
Stored size: 957 Bytes
Contents
/** * @fileoverview Rule to flag nested ternary expressions * @author Ian Christian Myers */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { docs: { description: "disallow nested ternary expressions", category: "Stylistic Issues", recommended: false, url: "https://eslint.org/docs/rules/no-nested-ternary" }, schema: [] }, create(context) { return { ConditionalExpression(node) { if (node.alternate.type === "ConditionalExpression" || node.consequent.type === "ConditionalExpression") { context.report({ node, message: "Do not nest ternary expressions." }); } } }; } };
Version data entries
43 entries across 43 versions & 1 rubygems