JSPM

  • Created
  • Published
  • Downloads 7494
  • Score
    100M100P100Q116070F
  • License MIT

A customisable linter to identify & fix patterns in Ethereum Solidity

Package Exports

  • solium

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (solium) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

solium

Gitter chat Build Status Latest News Snap Status

Solium is a Security & Style focused Linter for your Solidity Smart Contracts.

It provides powerful rules for writing cleaner, more secure contracts, automatic code formatting and simple-to-understand re-distributable configuration files.

Install

npm install -g solium
solium -V

Usage

In the root directory of your DApp:

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:all",
  "plugins": ["security"],
  "rules": {
    "quotes": ["error", "double"],
    "indentation": ["error", 4],
    "arg-overflow": ["warning", 3]
  }
}

To know which lint rules Solium applies for you, see Core rules and Security rules

Lint a single Solidity file

solium -f ./contracts/foobar.sol

Lint over a directory

solium -d contracts/

Or over the entire project using solium -d .. Solium lints all the files inside your project with .sol extension.

Fix lint issues

Solium automatically fixes your code to resolve whatever issues it can.

solium -d contracts --fix

IDE & Editor Integrations

Migrating from v0

If you're currently using Solium v0, we highly recommend you to migrate to v1. v1 is backward compatible and provides you with much greater flexibility to configure rules, powerful security rules and auto code formatting among other features.

Access the complete Documentation