Socket
Socket
Sign inDemoInstall

solium

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solium

Linter to identify & fix Style & Security issues in Solidity


Version published
Weekly downloads
1.5K
increased by20.27%
Maintainers
1
Weekly downloads
 
Created
Source

Solium

Gitter chat Build Status Latest News Snap Status

Solium analyzes your Solidity code for style & security issues and fixes them.

Standardize Smart Contract practices across your organisation. Integrate with your build system. Deploy with confidence!

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

solium -f foobar.sol
solium -d contracts/

Configure with comments [BETA]

Comment Directives can be used to configure Solium to ignore specific pieces of code. They follow the pattern solium-disable<optional suffix>.

If you only use the directive, Solium disables all rules for the marked code. If that's not desirable, specify the rules to disable after the directive, separated by comma.

  • Disable linting on a specific line
contract Foo {
	/* solium-disable-next-line */
	function() {
		var bar = 'Hello world';	// solium-disable-line quotes

		// solium-disable-next-line security/no-throw, indentation
						throw;
	}
}
  • Disable linting on entire file
/* solium-disable */

contract Foo {
	...
}

Fix

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.

Trusted by the best

Access the complete Documentation

Keywords

FAQs

Package last updated on 16 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc