Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add linting to template/contracts/ #443

Open
kyhyco opened this issue Feb 25, 2024 · 1 comment
Open

Feature Request: Add linting to template/contracts/ #443

kyhyco opened this issue Feb 25, 2024 · 1 comment

Comments

@kyhyco
Copy link
Contributor

kyhyco commented Feb 25, 2024

Describe the solution you'd like

Took a look at linters for solidity:

solhint

solhint is a linter with rules. Similar control mechanisms to eslint, supporting disabling rules via comments and allow you to create new rules.

solhint provides additional styling rules that augments forge fmt or prettier-solidity-plugin. Pretty neat.

ethlint

Project appears to be inactive


ethlint is out as it is inactive.

For solhint, we need to add two files: .solhint.json and .solhintignore.

In .solhint.json, we need to decide which rules sets to follow. solhint:recommended option looks good but would like to hear from more experienced solidity developers on which rule sets to enable / how their experience with solhint has been.

In .solhintignore, lib should be added as we don't want to lint third party imports.

Been using solhint for a couple days and it's been decent so far.

Describe alternatives you've considered.

No response

@awilliams1-cb
Copy link
Contributor

Yeah besides forge fmt, solhint is the only other linter I've seen used before. forge fmt does have its own section in the config file that we could also set to get more use out of it. Regarding which rules to use for solhint, the recommended Best Practices and Style Guide Rules sections look good. However, the Security Rules look pretty out of date / not of high fidelity to be worth enabling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants