Linting & Formatting

evergreenLast update on Jul 9, 2026
Download .md

JavaScript / TypeScript / Astro

ESLint

Config: eslint.config.js

import eslintPluginAstro from "eslint-plugin-astro";

export default [
  ...eslintPluginAstro.configs["flat/recommended"],
  {
    ignores: ["dist/", ".astro/", "node_modules/"],
  },
];

Per-project bisa ditambah plugin sesuai stack (React, Svelte, dll).

Script package.json:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

Prettier

Config: .prettierrc

{
  "plugins": ["prettier-plugin-astro"],
  "overrides": [
    {
      "files": "*.astro",
      "options": {
        "parser": "astro"
      }
    }
  ]
}

Biome (Zed Editor)

Untuk project yang pure TypeScript/JavaScript, bisa ganti ke Biome yang lebih cepat. Biome handle linting + formatting sekaligus.

Script package.json:

{
  "scripts": {
    "lint": "biome check .",
    "format": "biome format --write .",
    "format:check": "biome check --formatter-enabled=true"
  }
}

Go

Gunakan tooling bawaan Go:

# Formatting
gofmt -l -w .

# Linting (standalone)
go vet ./...

# Linting (comprehensive) — install golangci-lint
golangci-lint run ./...

PHP / Laravel

# Formatting
./vendor/bin/pint

# Linting (Laravel)
./vendor/bin/phpstan analyse --memory-limit=2G