Skip to main content

Cadence Linter

The Cadence Linter is a static-analysis tool for finding potential issues in Cadence code. It is available in the Flow CLI & is designed to help developers write better code by identifying common mistakes and potential issues before they become problems.

The linter will also check your code for any syntax or semantic errors, and provide suggestions for how to fix them.


_10
flow cadence lint [files]

Example Usage​


_10
flow cadence lint **/*.cdc

Example Output​


_10
test.cdc:27:6: semantic-error: cannot find variable in this scope: `abc`
_10
_10
test.cdc:35:6: removal-hint: unnecessary force operator
_10
_10
2 problems (1 error, 1 warning)

info

The Cadence Linter is also available in the Cadence VSCode extension, which provides real-time feedback as you write your code.