Skip to content

Linting Tools

This template uses a comprehensive set of linters and formatters, all enforced via pre-commit hooks and CI.

Pre-commit Hooks

All hooks are defined in .pre-commit-config.yaml. Install once:

bash
pre-commit install
pre-commit install --hook-type commit-msg

Tool Reference

Code Quality

ToolLanguage / TypeWhat it checks
prettierJS/TS/CSS/JSON/YAML/MDFormatting
eslintJavaScript / TypeScriptCode quality, best practices
ruffPythonLinting + formatting
gofmt / goimportsGoFormatting, imports
rustfmtRustFormatting
rubocopRubyLinting + formatting
google-java-formatJavaFormatting
ktlintKotlinFormatting
swiftformat / swiftlintSwiftFormatting + linting
dotnet formatC# / .NETFormatting
dartfmtDartFormatting
PSScriptAnalyzerPowerShellLinting
shellcheckShell scriptsCorrectness, portability

Markdown & Docs

ToolWhat it checks
markdownlint-cli2Markdown style and structure
prettierMarkdown formatting
lycheeBroken links in docs
spectralOpenAPI/AsyncAPI spec linting

Security

ToolWhat it checks
gitleaksSecrets and credentials in code
trivyContainer and dependency vulnerabilities
cargo auditRust dependency vulnerabilities
pip-auditPython dependency vulnerabilities
npm auditNode.js dependency vulnerabilities
govulncheckGo dependency vulnerabilities

Formatting & Structure

ToolWhat it checks
sort-package-jsonpackage.json key ordering
dotenv-linter.env file formatting
commitlintCommit message format (Conventional Commits)
actionlintGitHub Actions workflow syntax

Running Manually

bash
# Run all hooks on all files
pre-commit run --all-files

# Run a specific hook
pre-commit run prettier --all-files
pre-commit run markdownlint-cli2 --all-files
pre-commit run shellcheck --all-files

# Run commitlint
echo "feat: my feature" | commitlint

CI Integration

All linters run in the lint job of .github/workflows/lint.yml. Failures block merging.

Released under the MIT License.