eslint-plugin-nebulas-contract
v0.0.22
Published
Additional ESLint's rules for Nebulas Smart Contracts
Downloads
12
Maintainers
Readme
eslint-plugin-nebulas-contract
ESLint rules for Nebulas Smart Contracts
Install
$ npm install --save-dev eslint eslint-plugin-nebulas-contract
Recommended configuration
Configure it in package.json
.
{
"name": "my-nebulas-contract-project",
"eslintConfig": {
"env": {
"es6": true
},
"plugins": [
"nebulas-contract"
],
"extends": "plugin:nebulas-contract/recommended",
"rules": {
}
}
}
Rules
no-window - Forbid the use of
window
.no-es6 - Forbid some ES2015 modules usage.
no-settimeout - Forbid the use of
setInterval
setTimeout
.available-libs - Available libraries are
crypto.js
.module-exports -
module.exports =
is necessary inside of contract.valid-contract - Contract must be a Prototype Object or Class in JavaScript or TypeScript , and include an init function.
valid-blockchain-api - The Blockchain API check is provided.
valid-local-contract-storage-api - The LocalContractStorage API check is provided.
valid-event-api - The Event API check is provided.
no-dupe-keys-in-local-contract-storage.md - disallow duplicate keys in LocalContractStorage.
Unit Tests
$ npm install
$ npm run test
See ESLint documentation for more information about extending configuration files.
MIT © yucopowo