返回 Skill 列表
extension
分类: 开发与工程无需 API Key

linting-neostandard-eslint9

配置ESLint v9平面配置和neostandard用于JavaScript和TypeScript项目,包括从旧版`.eslintrc*`文件或`standard`包迁移。当您需要用`eslint.config.js`或`eslint.config.mjs`设置或修复代码检查、排查代码检查错误、配置neostandard规则、从`.eslintrc`迁移到平面配置,或将代码检查集成到CI流水线和预提交钩子中时使用。

person作者: jakexiaohubgithub

When to use

Use this skill when you need to:

  • Set up linting in a JavaScript or TypeScript project
  • Use neostandard as a Standard-like ESLint v9 flat-config baseline
  • Configure eslint@9 with the flat config system (eslint.config.js/eslint.config.mjs)
  • Migrate from standard to neostandard or ESLint v9
  • Migrate from legacy .eslintrc* configuration to ESLint v9
  • Run linting consistently in CI and local development

Quick start: basic neostandard setup

Install dependencies and create a minimal eslint.config.js:

npm install --save-dev eslint@9 neostandard
// eslint.config.js
import neostandard from 'neostandard'

export default neostandard()

Verify the config works:

npx eslint .

Common setup workflow (new project)

  1. Install eslint@9 and neostandard (see Quick start above)
  2. Create eslint.config.js with neostandard() as the base
  3. Add any project-specific rule overrides on top
  4. Run npx eslint . to confirm no config errors
  5. Add a lint script to package.json: "lint": "eslint ."
  6. Integrate into CI with a non-fix run; use --fix only in local workflows

How to use

Read individual rule files for implementation details and examples:

Core principles

  • Prefer reproducible linting with pinned major versions
  • Keep config minimal and explicit
  • Use flat config for ESLint v9 projects
  • Treat lint failures as quality gates in CI
  • Enable auto-fix for local workflows, but validate with non-fix CI runs