-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolhint.config.js
41 lines (38 loc) · 1.44 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
/**
* Set the Solidity compiler version
*/
const COMPILER_VERSION = "0.8.17"
/**
*
* - 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": "warn",
// Security Rules
"compiler-version": ["warn", COMPILER_VERSION],
"avoid-sha3": "error",
"avoid-suicide": "error",
"avoid-throw": "error",
"not-rely-on-time": "off",
},
}