-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsolhint.config.js
47 lines (44 loc) · 1.65 KB
/
solhint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* Set the Solidity compiler versions
*/
const SOLC_COMPILER_VERSIONS = ['0.8.15']
/**
*
* - Github: https://github.com/protofire/solhint
* - Supported Rules: https://github.com/protofire/solhint/blob/master/docs/rules.md
* - Configure linter with inline comments:
* https://github.com/protofire/solhint#configure-the-linter-with-comments
* - Create a shareable solhint config through npm:
* https://github.com/protofire/solhint/blob/master/docs/shareable-configs.md
* - "error", "warn", "off" are generally the choices below
*/
module.exports = {
extends: 'solhint:recommended',
plugins: [],
rules: {
// Best Practice Rules
'constructor-syntax': 'warn',
'max-line-length': ['error', 120],
// "code-complexity": ["warn", 7], // Not included in recommended
// "function-max-lines": [ "warn",50 ], // Not included in recommended
// Style Guide Rules
'func-visibility': ['error', { ignoreConstructors: true }], // Set ignoreConstructors to true if using solidity >=0.7.0
'reason-string': ['warn', { maxLength: 50 }], // Revert reason length
'func-param-name-mixedcase': 'error',
'modifier-name-mixedcase': 'error',
'private-vars-leading-underscore': ['error', { strict: false }],
ordering: 'error',
// Security Rules
'compiler-version': [
// SOLC_COMPILER_VERSIONS.length == 1 ? 'error' : 'warn',
'warn',
SOLC_COMPILER_VERSIONS[0],
// NOTE: Custom value added in template to support exporting multiple compiler versions
SOLC_COMPILER_VERSIONS,
],
'avoid-sha3': 'error',
'avoid-suicide': 'error',
'avoid-throw': 'error',
// "not-rely-on-time": "off",
},
}