Add custom linting rules (#4132)

Co-authored-by: Francisco Giordano <fg@frang.io>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Luiz Hemerly
2023-07-10 17:26:02 -03:00
committed by GitHub
parent 2a4396c9dd
commit cd981f6521
6 changed files with 127 additions and 15 deletions

20
solhint.config.js Normal file
View File

@ -0,0 +1,20 @@
const customRules = require('./scripts/solhint-custom');
const rules = [
'no-unused-vars',
'const-name-snakecase',
'contract-name-camelcase',
'event-name-camelcase',
'func-name-mixedcase',
'func-param-name-mixedcase',
'modifier-name-mixedcase',
'var-name-mixedcase',
'imports-on-top',
'no-global-import',
...customRules.map(r => `openzeppelin/${r.ruleId}`),
];
module.exports = {
plugins: ['openzeppelin'],
rules: Object.fromEntries(rules.map(r => [r, 'error'])),
};