Files
memecoin-botV2/.pnpm-store/v10/files/dc/2a11fae8aee074cc25bfeebe8328c2750b1658bf684347ed56ef3f4751eab528bf61f91e2f69c9c25298de6c2f04aabc1637daed9ec55adabc65089b3d2356

43 lines
832 B
Plaintext

/**
* @fileoverview Rule to flag when initializing octal literal
* @author Ilya Volodin
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow octal literals",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-octal",
},
schema: [],
messages: {
noOctal: "Octal literals should not be used.",
},
},
create(context) {
return {
Literal(node) {
if (typeof node.value === "number" && /^0\d/u.test(node.raw)) {
context.report({
node,
messageId: "noOctal",
});
}
},
};
},
};