Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keep-network/solium-config-keep
Standard configuration for linting Solidity code using ethlint/Solium.
https://github.com/keep-network/solium-config-keep
Last synced: 18 days ago
JSON representation
Standard configuration for linting Solidity code using ethlint/Solium.
- Host: GitHub
- URL: https://github.com/keep-network/solium-config-keep
- Owner: keep-network
- Created: 2019-06-06T15:07:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T06:05:33.000Z (about 2 years ago)
- Last Synced: 2024-04-13T00:15:17.292Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 454 KB
- Stars: 0
- Watchers: 14
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# solium-config-keep
Standard configuration for linting Solidity code using [ethlint/Solium](https://github.com/duaraghav8/Ethlint). Uses the `solium:recommended` ruleset, which itself is taken from the [Solidity Style Guide](https://solidity.readthedocs.io/en/v0.5.9/style-guide.html).
## Installation
`npm i https://github.com/keep-network/solium-config-keep.git`
## Usage
### Setting up a project
1. Install the linter and config - `npm i -D ethlint https://github.com/keep-network/solium-config-keep.git`
2. Create your `.soliumrc.json`:
```json
{
"extends": "keep",
"plugins": [
"security"
]
}
```
3. Add commands for linting to your `package.json`:
```json
{
"scripts": {
"sol:lint": "solium -d contracts/",
"sol:lint:fix": "solium -d contracts/ --fix"
}
}
```### Disabling the linter
#### Directory
Edit the `.soliumrc.json`.#### File
`/* solium-disable */`#### Code block
`/* solium-disable */`
`/* solium-enable */`#### Line
Prefer `/*` over `//`, as it looks different to a comment on the rationale of code.`/* solium-disable-next-line */`
`/* solium-disable-previous-line */`### Adding a pre-commit hook
```yaml
- repo: local
hooks:
- id: solium
name: Solidity linter
language: node
entry: solium
files: '\.sol$'
args:
- --dir=./contracts/
- --config=./.soliumrc.json
additional_dependencies:
- [email protected]
```