Skip to content

Slippy vs Solhint

This document explains some of the ways Slippy is different from Solhint.

While Slippy is not feature-complete compared to Solhint yet, it has several advantages over it:

  • A single, flexible configuration that lets you easily enable or disable rules for specific parts of your codebase.
  • A unified naming rule, naming-convention, inspired by typescript-eslint’s rule of the same name. Instead of having to mix and match multiple rules like const-name-snakecase, func-name-mixedcase, var-name-mixedcase, etc., Slippy lets you define a single rule that is as flexible as you need it to be.
  • The no-unused-vars rule offers more accurate detection of unused variables. It works with local variables, imports, private state variables, and private functions. It also supports an ignorePattern option so you can mark variables as intentionally unused (e.g. with a leading underscore).
  • Slippy supports inline configuration comments like // slippy-disable-line, just like Solhint. But Slippy also validates that comment directives are effective: if a comment doesn’t do anything, you’ll get a warning. This avoids stale comments that only pollute the codebase.
  • Slippy doesn’t include any formatting rules, keeping the focus on code quality and correctness. Instead, you should use Prettier Solidity to automatically format your code.
  • Slippy follows semantic versioning and will never introduce breaking changes in minor releases.
  • Fewer built-in rules. Not every Solhint rule has a direct equivalent in Slippy. Some of them are easy to add if there’s demand. Others will never be added, for various reasons. On the other hand, Slippy already has some rules that are not supported by Solhint, like no-uninitialized-immutable-references or curly. See the rules comparison below for more details.
  • No plugins. Adding new functionality through plugins is not supported in Slippy yet.
  • No browser support. Slippy doesn’t have a browser build, but it’s designed so that this is easy to add.

This section details the differences between Slippy and Solhint rules.

Solhint ruleSlippy equivalent
avoid-tx-originno-tx-origin
const-name-snakecasenaming-convention
contract-name-capwordsnaming-convention
duplicated-importsno-duplicate-imports
event-name-capwordsnaming-convention
explicit-typesexplicit-types
foundry-test-functionsnaming-convention
func-name-mixedcasenaming-convention
func-param-name-mixedcasenaming-convention
gas-custom-errorsrequire-revert-reason
gas-named-return-valuesnamed-return-params
immutable-vars-namingnaming-convention
imports-on-topimports-on-top
imports-ordersort-imports
interface-starts-with-inaming-convention
max-states-countmax-state-vars
modifier-name-mixedcasenaming-convention
no-consoleno-console
no-empty-blocksno-empty-blocks
no-global-importno-global-imports
no-unused-importno-unused-vars
no-unused-varsno-unused-vars
one-contract-per-fileone-contract-per-file
orderingsort-members
private-vars-leading-underscorenaming-convention
reason-stringrequire-revert-reason
state-visibilityno-default-visibility
use-forbidden-nameid-denylist
var-name-mixedcasenaming-convention
visibility-modifier-ordersort-modifiers

To the best of my knowledge, the following Slippy rules are not supported by Solhint:

Slippy rule
compatible-pragma
curly
no-send
no-restricted-syntax
no-unchecked-calls
no-uninitialized-immutable-references
no-unnecessary-boolean-compare
no-unnecessary-else
private-vars
yul-prefer-iszero

Solhint rules that could be added to Slippy

Section titled “Solhint rules that could be added to Slippy”

These are rules that I’m not sure about adding, but where I could change my mind. Please open an issue if you think one of these should be included.

Solhint rule
avoid-call-value
avoid-low-level-calls
code-complexity
compiler-version
comprehensive-interface
func-named-parameters
function-max-lines
gas-calldata-parameters
gas-increment-by-one
gas-indexed-events
gas-length-in-loops
gas-small-strings
gas-strict-inequalities
gas-struct-packing
named-parameters-mapping
no-complex-fallback
no-inline-assembly
not-rely-on-block-hash
not-rely-on-time
payable-fallback
use-natspec

Solhint rules that won’t be added to Slippy

Section titled “Solhint rules that won’t be added to Slippy”

These are rules I’m 99% sure won’t be added to Slippy. This can be due to being obsolete, out of scope, or because it’s unclear if they are useful. If you disagree with any of these, please open an issue.

Solhint rule
avoid-sha3
avoid-suicide
avoid-throw
constructor-syntax
func-visibility
gas-multitoken1155
import-path-check
max-line-length
quotes
reentrancy
multiple-sends