pickstack

React + Husky + lint-staged

Git pre-commit hook that lints and formats staged files. This page shows exactly what pickstack adds to a React 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 react --modules eslint,husky-lint-staged --yes
Customize in the configurator

Packages it adds

PackageVersionType
@eslint/js^10.0.1dev
eslint^10.15.0dev
eslint-plugin-react-hooks^7.1.1dev
eslint-plugin-react-refresh^0.5.8dev
globals^17.14.0dev
husky^9.1.7dev
lint-staged^17.6.2dev
typescript-eslint^8.74.0dev

New files

.husky/pre-commit
lint-staged
eslint.config.js
import js from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tseslint from "typescript-eslint";

export default defineConfig([
  globalIgnores(["dist"]),
  {
    files: ["**/*.{ts,tsx}"],
    extends: [
      js.configs.recommended,
      tseslint.configs.recommended,
      reactHooks.configs.flat.recommended,
      reactRefresh.configs.vite,
    ],
    languageOptions: {
      globals: globals.browser,
    },
  },
]);

Project files

Related templates