Astro + Husky + lint-staged
Git pre-commit hook that lints and formats staged files. This page shows exactly what pickstack adds to a Astro project for Husky + lint-staged: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.
$ npm create pickstack@latest my-app -- --framework astro --modules eslint,husky-lint-staged --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
@eslint/js | ^10.0.1 | dev |
eslint | ^10.15.0 | dev |
eslint-plugin-astro | ^3.2.1 | dev |
globals | ^17.14.0 | dev |
husky | ^9.1.7 | dev |
lint-staged | ^17.6.2 | dev |
typescript-eslint | ^8.74.0 | dev |
New files
lint-staged
import js from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import eslintPluginAstro from "eslint-plugin-astro";
import globals from "globals";
import tseslint from "typescript-eslint";
export default defineConfig([
globalIgnores(["dist", ".astro"]),
js.configs.recommended,
tseslint.configs.recommended,
eslintPluginAstro.configs.recommended,
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
},
},
]);
Changes to existing files
⋯ 4 unchanged lines <Layout title="About"> <section class="page"> <h1 class="title">About</h1>+ <p class="text">+ Built with Astro, TypeScript, ESLint, Husky, lint-staged.+ </p>− <p class="text">Built with Astro, TypeScript.</p> </section> </Layout>
Project files
.gitignore.husky/pre-commitREADME.mdastro.config.mjseslint.config.jspackage.jsonsrc/components/Counter.astrosrc/layouts/Layout.astrosrc/pages/about.astrosrc/pages/index.astrosrc/styles/global.csstsconfig.json