Solhint Project
This is an open source project for linting solidity code. This project provide both security and style guide validations.
Installation
You can install Solhint using npm:
npm install -g solhint
# verify that it was installed correctly
solhint -V
Usage
For linting Solidity files you need to run Solhint with one or more
Globs as arguments. For example, to lint all files inside
contracts
directory, you can do:
solhint "contracts/**/*.sol"
To lint a single file:
solhint contracts/MyToken.sol
Solhint command description:
Usage: solhint [options] <file> [...other_files]
Linter for Solidity programming language
Options:
-V, --version output the version number
-f, --formatter [name] report formatter name (stylish, table, tap, unix)
-w, --max-warnings [maxWarningsNumber] number of warnings to trigger nonzero
-q --quiet report errors only - default: false
--ignore-path [file_name] file to use as your .solhintignore
-h, --help output usage information
Commands:
stdin [options] put source code to stdin of this utility
init-config create sample solhint config in current folder
You can use any of the following formatters supported by ESLint. See EsLint docs about formatters here.
- checkstyle
- codeframe
- compact
- html
- jslint-xml
- junit
- stylish
- table
- tap
- unix
- visualstudio
Docs
Table of Contents
- Roadmap: The core project’s roadmap - what the core team is looking to work on in the near future.
- Contributing: The core Solhint team :heart: contributions. This describes how you can contribute to the Solhint Project.
- Shareable configs: How to create and share your own configurations.
- Writing plugins: How to extend Solhint with your own rules.
IDE Integrations
- Sublime Text 3
- Atom
- Vim
- JetBrains IDEA, WebStorm, CLion, etc.
- VS Code: Solidity by Juan Blanco
- VS Code: Solidity Language Support by CodeChain.io
Licence
MIT
Back Us
Solhint is free to use and open-sourced. If you value our effort and feel like helping us to keep pushing this tool forward, you can send us a small donation. We’ll highly appreciate it :)