s2-lint

修改 S2 项目代码后需执行代码质量检查,确保类型、语法、样式及文档符合规范,避免提交时引发构建失败,所有问题修复并通过校验后任务才算完成。

快捷安装

在终端运行此命令,即可一键安装该 Skill 到您的 Claude 中

npx skills add antvis/S2 --skill "s2-lint"

S2 Lint

When to use this skill

After modifying any code files in the packages/ directory, you must use this skill before finishing the task.

This includes but is not limited to:

  • Modifying .ts, .tsx, .vue files
  • Adding new source code files
  • Modifying type definition files (.d.ts)
  • Modifying import/export statements
  • Modifying .less style files
  • Modifying .md documentation files

Execution Steps

After completing all code modifications, run the following command in the project root:

pnpm lint

This command runs the following checks sequentially:

  • lint:type - TypeScript type checking
  • lint:script - ESLint code style checking
  • lint:style - Stylelint CSS/LESS checking
  • lint:docs - MarkdownLint documentation checking
  • lint:word - Case-police word casing checking

Handling Errors

If the command reports errors:

  1. Carefully read the error message to determine the location and cause of the error.
  2. Fix all errors to ensure code quality.
  3. Re-run pnpm lint to confirm all errors are fixed.
  4. The task is considered complete only after lint passes.

Notes

  • Do not ignore lint errors; they may cause build failures in the CI/CD pipeline.
  • If some errors are difficult to fix, inform the user and discuss solutions.
  • This check is a necessary step before pushing code to git.