javascript-linter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lint JavaScript code

Lint JavaScript 代码

Linting catches bugs before runtime, enforces team coding standards, and prevents common mistakes that slip through code review.
Linting 能够在运行前发现Bug,强制执行团队编码规范,并避免那些逃过代码审查的常见错误。

Quick Reference

快速参考

  • Set up ESLint with
    pnpm dlx eslint --init
  • Use shared configs (eslint:recommended, @typescript-eslint)
  • Integrate with your editor for real-time feedback
  • Add lint checks to CI/CD pipeline
  • 使用
    pnpm dlx eslint --init
    配置 ESLint
  • 使用共享配置(eslint:recommended、@typescript-eslint)
  • 与编辑器集成以获得实时反馈
  • 将Lint检查添加到CI/CD流水线中

Check

检查

Set up JavaScript linting tools like ESLint to automatically detect syntax errors, enforce coding standards, and maintain consistent code quality across the team.
配置ESLint等JavaScript Lint工具,自动检测语法错误,强制执行编码规范,保持团队代码质量的一致性。

Fix

修复

Configure ESLint with appropriate rules and plugins, integrate it into your development workflow, and fix all linting errors and warnings.
为ESLint配置合适的规则和插件,将其集成到你的开发工作流中,并修复所有Linting错误和警告。

Explain

说明

Explain how JavaScript linting prevents bugs, enforces consistent coding standards, improves code readability, and catches potential issues before runtime.
说明JavaScript Linting如何预防Bug、强制执行一致的编码规范、提升代码可读性,并在运行前发现潜在问题。

Code Review

代码审查

Review scripts, client components, and browser execution paths related to Lint JavaScript code. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.

For full implementation details, code examples, and framework-specific guidance, see
references/rule.md
.
审查与Lint JavaScript代码相关的脚本、客户端组件和浏览器执行路径。标记违反规则的具体导入语句、事件处理器、运行时副作用或阻塞操作,并说明应如何在浏览器中验证更改。

完整的实现细节、代码示例和特定框架的指导,请参阅
references/rule.md
。