Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Latest commit

 

History

History
106 lines (66 loc) · 3.3 KB

README.en.md

File metadata and controls

106 lines (66 loc) · 3.3 KB

NasLint

npm Travis (.org)

Linter for smart contracts on Nebulas blockchain.

screenshot

How to use

Precondition

Node.js 10+ and npm 6+.

Install globally

Run this command to install as a global command:

$ npm i -g naslint

Then, we can use this command naslint anywhere:

$ naslint my-contract.js

It will lint specified contract file, and output a report.

Install locally

Run this command in your project's folder to install as a local development dependency:

$ npm i -D naslint

Then, add a script in your package.json file, like this:

{
  "scripts": {
    "lint": "naslint ./my-contract.js"
  }
}

Thereafter, your can run this script to lint specified contract file:

$ npm run lint

Rules

NasLint validates contract code with these built-in rules.

Rule name Functionality Doc
export-contract Ensure an export is a smart contract object. []
export Ensure an export is present. []
limited-libs Report unsupported third-party library. []
no-esm Report ESM import calls and export. []
no-undef Report undefined variables. []

FAQ

Does NasLint validate contract written in TypeScript?

Sure. NasLint can handle contract code in both JavaScript and TypeScript.

Does NasLint conflict with ESLint? What if I use ESLint simultaneously in my project?

No conflict. These two works completely independently.

Just use ESLint as usual. You can config ESLint in the way your like, these configuration for ESLint will never interference NasLint.

Community

WeChat group

Add group master cssmagic, who will invite you in.

Contributors  

Name Contribution [*] Remark
@newraina 🤔 💻 🚇 🔌 ⚠️ 📖 Founder
@cssmagic 🤔 🌍 📖

[*] These legends follow the emoji-key of "all-contributors" specification. Contributions of any kind are welcome!


Thanks

NasLint is based on these open source projects:

License

MIT