UNPKG

eslint-plugin-o1js

Version:

o1js rules for ESLint

27 lines 955 B
"use strict"; const selectors_1 = require("../utils/selectors"); const rule = { meta: { messages: { noConstructorInSmartContract: 'Overriding the constructor of a SmartContract is disallowed. Please remove the constructor.', }, schema: [], type: 'problem', docs: { description: 'Overriding the constructor of a SmartContract is disallowed. Please remove the constructor.', recommended: 'error', }, }, create(context) { return { [`${selectors_1.SMART_CONTRACT_DEFINITION} > ClassBody > MethodDefinition[key.name="constructor"]`]: function (constructorNode) { context.report({ messageId: `noConstructorInSmartContract`, loc: constructorNode.loc, }); }, }; }, }; module.exports = rule; //# sourceMappingURL=no-constructor-in-smart-contract.js.map