Introducing Solium v1
Solium is an open sourced linter to identify and fix style & security issues in Ethereum’s Solidity.
We started building Solium with a vision that developers can deploy smart contracts with complete confidence of code quality and security. Over the past year, we’ve seen the tool grow to be trusted by some of the biggest names in the blockchain ecosystem like Augur, Aragon, ConsenSys & Zeppelin.
Today, I am excited to announce that Solium v1
is finally out in Beta!
A while back, there was an extensive discussion on which direction this project is headed in. We agreed that it certainly needs to have a more ESLint-like interface, since we saw a lot of web developers entering the smart contract ecosystem.
We’ve now completely revamped the linter. Amongst its most notable improvements are Sharable Configs, a neat Plugin System, automatic code formatting and more flexibility to configure rules.
Earlier, the configuration possible for rules was either to turn them off or on. This was because v0
was designed to strictly follow the Solidity Style Guide, so you could either accept a rule by the guide or reject it. There was no changing it. This forced a lot of organisations to fork and maintain their own Solium if, for example, they wanted to enforce 2 spaces instead of 4. Hence the decision to move to a completely customisable static analyser.
The new soliumrc.json
looks like:
You can now program core (or plugin) rules to accept options from users that can modify the rule’s default behaviour. Awesome!
Devs can now write and re-distribute their own Lint Rules!
Well, the heading says it all :) See building Solium Plugins
Install
npm install -g solium@v1-beta
View documentation.
Migrating from v0
If you currently rely on Solium v0 for linting your solidity code, you can easily move to v1 without facing breaking changes.
The only 2 breaking changes v1 introduces is the discontinuation of custom-rules-filename
attribute in soliumrc.json
and the --sync
option — both features were rarely used and provided negligible benefit. So if you haven’t used any of these 2 features, you’re good to upgrade!
Got feedback?
Talk to us in the comments below, in issues or our Gitter Channel. We’d be happy to hear you out!
A lot more is yet to come…
In our documentation, we listed out a few known issues and a rough roadmap. That’s what we’ll be working on in the coming days.