solhint-config-wonderland
v0.0.1
Published
A solhint shareable config following defi-wonderland's conventions
Readme
solhint-config-wonderland
A shareable config for solhint, implementing all of our boilerplate's rules
Why
Usually we start developing new projects from our foundry boilerplate , which enforces a sane default configuration for our linter, with all rules configured just how we like them.
However, when updating the definitions in the boilerplate, propagating that to individual repos was a manual and tedious process, causing different repositories to diverge in their coding styles.
This centralizes the setting of rules to a single location, making proyects able to stay up-to-date by simply upgrading an npm dependency.
How to use this
First, install this package as a dependency of the project:
yarn add --save=dev solhint-config-wonderlandCausing the following modification to package.json:
...
"solhint-config-wonderland": "0.0.0",
...[!NOTE] The package name as defined in
package.jsonhas to start withsolhint-configto be recognized as a shareable config by the linter.
Then, you can replace your .solhint.json, instructing to use the shareable config:
{ "extends": "wonderland"}We also ship variants specific to interfaces, scripts and test files, which you can use as follows:
{ "extends": "wonderland/tests"}{ "extends": "wonderland/scripts"}{ "extends": "wonderland/interfaces"}Note that you can still override this in your project by defining a rules key, which will take precedence:
{
"extends": "wonderland/interfaces",
"rules": {
"ordering": "off"
}
}