clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

Improve clarinet's clarity linter

Open smcclellan opened this issue 2 years ago • 1 comments

Linting rules can be configured to be “off”, “info”, “warning” or “error”. Default value is indicated here between parenthesis.

  • dead code
    • unused constant (warning)
    • unused function parameter (warning)
    • unused let binding (warning)
    • unused private function (warning)
  • unsafe
    • avoid unwrap-panic (warning)
    • avoid unwrap-err-panic (warning)
  • prefer native function aliases (introduced in clarity 2 and versions to come)
    • prefer element-at? (instead of element-at) (warning)
    • prefer index-of? (instead of index-of) (warning)
    • prefer bit-xor (instead of xor) (warning)
  • convention
    • invalid naming case (info)

smcclellan avatar Jul 27 '23 21:07 smcclellan

We could also add a check for a function that is defined as public but could be readonly. It should always be preferred to make the function read-only if it doesn't need to modify any state so that it is clear that it can be called via the API.

obycode avatar Jun 04 '24 13:06 obycode