xiaohongshu
xiaohongshu
eslint-prettier-husky-config
This skill should be used when setting up code quality tooling with ESLint v9 flat config, Prettier formatting, Husky git hooks, lint-staged pre-commit checks, and GitHub Actions CI lint workflow. Apply when initializing linting, adding code formatting, configuring pre-commit hooks, setting up qu...
Full skill instructions
Configure comprehensive code quality tooling for Next.js/React projects using ESLint v9 (flat config), Prettier, Husky git hooks, lint-staged, and CI lint checks.
Install required packages for ESLint v9, Prettier, and git hooks:
npm install -D eslint@^9 @eslint/js eslint-config-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y prettier husky lint-staged
For TypeScript projects, add:
npm install -D @typescript-eslint/parser @typescript-eslint/eslint-plugin typescript-eslint
Create eslint.config.mjs in project root using the provided template from assets/eslint.config.mjs. This flat config format:
Customize the configuration based on project needs:
languageOptions.parserOptions for different ECMAScript versionsrules to match team preferencesCreate .prettierrc in project root using the template from assets/.prettierrc. This configuration:
Adjust formatting rules to match team style guide.
Create .prettierignore using assets/.prettierignore to exclude:
Initialize Husky for git hooks:
npx husky init
This creates .husky/ directory with a pre-commit hook.
Replace the pre-commit hook content with:
npx lint-staged
Add lint-staged configuration to package.json using the example from references/package-json-config.md:
{
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md,yml,yaml}": [
"prettier --write"
]
}
}
This runs ESLint and Prettier on staged files before each commit.
Add the following scripts to package.json (see references/package-json-config.md for complete example):
{
"scripts": {
"lint": "eslint . --max-warnings 0",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"prepare": "husky"
}
}
These scripts enable:
npm run lint - Check for linting errors (fails on warnings)npm run lint:fix - Auto-fix linting issuesnpm run format - Format all files with Prettiernpm run format:check - Check formatting without modifying filesprepare - Automatically set up Husky when installing dependenciesCreate .github/workflows/lint.yml using the template from assets/github-workflows-lint.yml. This workflow:
Customize the workflow:
Test the complete setup:
npm run lint to verify ESLint configurationnpm run format:check to verify Prettier configurationFix any configuration issues:
npm run formatDocument the setup for team members (see references/team-documentation.md for template):
Adjust rule severity in eslint.config.mjs:
"off" - Disable rule"warn" - Warning (doesn't fail CI)"error" - Error (fails CI)Common customizations:
'react/prop-types': 'off''max-len': ['error', { code: 120 }]Modify formatting in .prettierrc:
printWidth - Line length limittabWidth - Spaces per indentation levelsemi - Semicolon preferencesingleQuote - Quote styletrailingComma - Trailing comma rulesCustomize pre-commit checks in package.json:
Example with type checking:
{
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix",
"prettier --write",
"tsc-files --noEmit"
]
}
}
ESLint errors on existing code: Run npm run lint:fix then npm run format to auto-fix most issues.
Husky hooks not running: Ensure npm install was run after Husky initialization. Check .husky/pre-commit is executable.
CI failing but local passes: Verify Node.js version matches between local and CI. Check that all dependencies are in package.json.
Conflicts between ESLint and Prettier: Ensure eslint-config-prettier is last in extends array to disable conflicting ESLint formatting rules.
No executable scripts needed for this skill.
package-json-config.md - Complete package.json example with all scripts and lint-staged configurationteam-documentation.md - Template for documenting the setup for team memberseslint.config.mjs - ESLint v9 flat config template with React, TypeScript, and Next.js support.prettierrc - Prettier configuration with recommended settings.prettierignore - Files and directories to exclude from formattinggithub-workflows-lint.yml - GitHub Actions workflow for automated lint checksxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience