Skip to content

Latest commit

 

History

History
175 lines (119 loc) · 2.66 KB

File metadata and controls

175 lines (119 loc) · 2.66 KB

Tooling: Linting, Formatting, and LSP

Nexgit treats linting, formatting, and editor/LSP setup as required project infrastructure.

The goal is to make contributions easier to review and reduce style debates.

Tool versions

Tool versions are provided through the two supported development environment entrypoints:

  • mise.toml
  • flake.nix

Choose one setup path from Development environments, then run the tooling commands below.

Formatting

Rust is formatted with rustfmt:

cargo fmt --all

Markdown, JSON, CSS, TypeScript, and TSX are formatted with Prettier:

pnpm format:prettier

Format everything:

pnpm format

Check formatting without writing changes:

pnpm format:check

Formatting config:

.editorconfig
.prettierrc.json
.prettierignore
rust-toolchain.toml
rustfmt.toml
flake.nix

Nix files are formatted through the flake formatter:

pnpm nix:fmt
pnpm nix:fmt:check

Linting

Rust linting uses Clippy with warnings denied:

pnpm lint:rust

Desktop linting uses ESLint flat config with TypeScript-aware rules:

pnpm lint:desktop

Run all linting:

pnpm lint

ESLint config:

apps/desktop/eslint.config.mjs

Type checking

Desktop TypeScript type checking:

pnpm typecheck

Rust workspace checking:

cargo check --workspace

Full local check

Before opening a pull request, run:

pnpm check

If you changed Nix files, also run:

pnpm nix:check
pnpm nix:fmt:check

This runs:

  1. Rust format check.
  2. Prettier check.
  3. Rust workspace check.
  4. Rust Clippy.
  5. Desktop ESLint.
  6. Desktop TypeScript check.

For docs-only changes, this is usually enough:

pnpm format:check
git diff --check

VS Code / Cursor / Windsurf setup

The repo includes recommended editor files:

.vscode/extensions.json
.vscode/settings.json

Recommended extensions:

  • rust-analyzer
  • Even Better TOML
  • Nix IDE
  • ESLint
  • Prettier
  • EditorConfig

The settings enable:

  • format on save
  • Prettier for web/docs files
  • rust-analyzer formatting for Rust
  • ESLint fixes on save when explicitly requested
  • rust-analyzer Clippy checks

Other editors

Use the equivalent language servers:

  • Rust: rust-analyzer
  • Nix: nixd
  • TypeScript/React: TypeScript language server
  • ESLint: ESLint language server
  • Formatting: Prettier, rustfmt, and nixfmt

CI enforcement

GitHub Actions are defined in:

.github/workflows/check.yml

CI checks the Nix flake, Nix formatting, Rust formatting, Rust compile/lint, Prettier formatting, desktop ESLint, desktop TypeScript, and desktop build.