• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    In common usage a linter detects code that is legal but likely a mistake, or code that doesn’t follow best practice.

    Although static type checkers do fit in that definition, that definition is overly broad and they would not be called a “linter”.

    Here is how static type checkers describe themselves:

    Pyright is a full-featured, standards-based static type checker for Python.

    Mypy is a static type checker for Python.

    TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

    Sorbet is a fast, powerful type checker designed for Ruby.

    Here is how linters describe themselves:

    Pylint is a static code analyser for Python 2 or 3. … Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored.

    (Ok I guess it’s a bit redundant for Pylint to say it is a linter.)

    Eslint: The pluggable linting utility for JavaScript and JSX

    Clippy: A collection of lints to catch common mistakes and improve your Rust code.

    Ruff: An extremely fast Python linter and code formatter, written in Rust.

    You get the idea… Linters are heuristic and advisory. Quite different to static type checking.