Ethlint (Formerly Solium) analyzes your Solidity code for style & security issues and fixes them.
See Documentation, Changelog and upcoming releases.
Before beginning to work on a contribution, please read the Guidelines.
npm install -g ethlint
solium -V
For backward-compatibility, you can still use npm install -g solium
.
If you're currently using the solium
package for npm install
, it is highly recommended that you move to ethlint
. The solium
package will not receive updates after December, 2019. There are no differences between the updates pushed to ethlint
and solium
packages.
In the root directory of your DApp, run:
solium --init
This creates 2 files for you:
.soliumignore
- contains names of files and directories to ignore while linting.soliumrc.json
- contains configuration that tells Solium how to lint your project. You should modify this file to configure rules, plugins and sharable configs.
.soliumrc.json
looks like:
{
"extends": "solium:recommended",
"plugins": ["security"],
"rules": {
"quotes": ["error", "double"],
"indentation": ["error", 4],
"linebreak-style": ["error", "unix"]
}
}
To know which lint rules Solium applies for you, see Style rules and Security rules.
NOTE
Solium does not strictly adhere to Solidity Style Guide. It aims to promote coding practices agreed upon by the community at large.
solium -f foobar.sol
solium -d contracts/