# solium

> Linter to identify and fix Style & Security issues in Solidity

Latest version **1.2.5** (published 2019-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install solium
pnpm add solium
yarn add solium
bun add solium
```

Provides the command `solium`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2019-09-14 |
| First published | 2016-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 942 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 920 |
| Author | Raghav Dua |
| Maintainers | the-mad-king |
| Keywords | lint, static-analysis, solidity, abstract-syntax-tree, ethereum, smart-contracts, ethlint, solium, blockchain, code-quality, dapp, developer-tools, security, soliumconfig, soliumplugin |

## Links

- npm: https://www.npmjs.com/package/solium
- Repository: https://github.com/duaraghav8/Ethlint
- Homepage: https://github.com/duaraghav8/Ethlint#readme
- Issues: https://github.com/duaraghav8/Ethlint/issues
- npm.io page: https://npm.io/package/solium

## Dependencies (13)

- [ajv](https://npm.io/package/ajv.md) ^5.2.2
- [eol](https://npm.io/package/eol.md) ^0.9.1
- [diff](https://npm.io/package/diff.md) ^3.5.0
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [lodash](https://npm.io/package/lodash.md) ^4.14.2
- [chokidar](https://npm.io/package/chokidar.md) ^1.6.0
- [solparse](https://npm.io/package/solparse.md) 2.2.8
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [sol-digger](https://npm.io/package/sol-digger.md) 0.0.2
- [text-table](https://npm.io/package/text-table.md) ^0.2.0
- [sol-explore](https://npm.io/package/sol-explore.md) 1.6.1
- [js-string-escape](https://npm.io/package/js-string-escape.md) ^1.0.1
- [solium-plugin-security](https://npm.io/package/solium-plugin-security.md) 0.1.1

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.2.5 (latest) — 2019-09-14
- 1.0.1 (v1-beta) — 2017-10-31
- 1.2.4 — 2019-04-08
- 1.2.3 — 2019-02-11
- 1.2.2 — 2019-01-13
- 1.2.1 — 2019-01-01
- 1.2.0 — 2018-12-26
- 1.1.8 — 2018-07-10
- 1.1.7 — 2018-04-30
- 1.1.6 — 2018-03-27
- 1.1.5 — 2018-02-14
- 1.1.4 — 2018-02-14
- 1.1.3 — 2018-01-20
- 1.1.2 — 2018-01-03
- 1.1.1 — 2018-01-03
- … 41 more at https://npm.io/package/solium/versions

## README

<p align="center">
  <img src="./art/Solium.png">
</p>

<br />

[![Build Status](https://travis-ci.org/duaraghav8/Ethlint.svg?branch=master)](https://travis-ci.org/duaraghav8/Ethlint)
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/Solium-linter/Lobby)

Ethlint (Formerly Solium) analyzes your Solidity code for style & security issues and fixes them.

See [Documentation](https://ethlint.readthedocs.io/), [Changelog](./CHANGELOG.md) and [upcoming releases](https://github.com/duaraghav8/Ethlint/projects).

Before beginning to work on a contribution, please read the [Guidelines](./CONTRIBUTING.md).

## Install
```bash
npm install -g ethlint
solium -V
```

For backward-compatibility, you can still use `npm install -g solium`.

If you're currently using the `solium` package for `npm install`, it is highly recommended that you move to `ethlint`. The `solium` package will not receive updates after December, 2019. There are no differences between the updates pushed to `ethlint` and `solium` packages.

## Usage
In the root directory of your DApp:
```bash
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:

```json
{
  "extends": "solium:recommended",
  "plugins": ["security"],
  "rules": {
    "quotes": ["error", "double"],
    "indentation": ["error", 4],
    "linebreak-style": ["error", "unix"]
  }
}
```

To know which lint rules Solium applies for you, see [Style rules](http://ethlint.readthedocs.io/en/latest/user-guide.html#list-of-style-rules) and [Security rules](https://www.npmjs.com/package/solium-plugin-security#list-of-rules).

---
**NOTE**

Solium does **not** strictly adhere to Solidity [Style Guide](http://solidity.readthedocs.io/en/latest/style-guide.html). It aims to promote coding practices agreed upon by the community at large.

---

### Lint
```bash
solium -f foobar.sol
solium -d contracts/
```

### Configure with comments
**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() {
		bytes32 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.
```bash
solium -d contracts/ --fix
```

## Our supporters
<p align="left">
  <a href="https://blog.ethereum.org/2018/03/07/announcing-beneficiaries-ethereum-foundation-grants/">
    <img src="./art/ethereum-logo.png" width="100" alt="Ethereum">
  </a>
  <a href="https://medium.com/@AugurProject/announcing-the-augur-bounty-program-bf11b1e1b7cf">
    <img src="./art/augur.png" width="70" alt="Augur">
  </a>
  &nbsp;&nbsp;
  <a href="https://gitcoin.co/universe?sort=None&direction=-&page=1&q=solium">
    <img src="./art/gitcoin.png" width="80" alt="Gitcoin">
  </a>
</p>

If Ethlint helped make your life simpler, please consider donating ETH to `0xacc661A56af9793a4437876a52F4Ad3fc3C443d6`

#### [IDE and Editor Integrations](http://solium.readthedocs.io/en/latest/user-guide.html#index-9) | [Documentation](https://ethlint.readthedocs.io) | [Demo Video](https://www.youtube.com/watch?v=MlQ6fzwixpI)

---
_Source: https://npm.io/package/solium · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
