Skills2026年5月16日·1 分钟阅读

Standard — Zero-Config JavaScript Style Guide and Linter

Standard is an opinionated JavaScript linter and formatter that enforces consistent code style with no configuration required, catching bugs and eliminating style debates.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Standard JS
通用 CLI 安装命令
npx tokrepo install e01dd26c-5165-11f1-9bc6-00163e2b0d79

Introduction

Standard is a JavaScript style guide, linter, and formatter that requires zero configuration. It enforces a consistent coding style across your project by bundling ESLint with a curated set of rules, removing the need to maintain .eslintrc files or debate formatting choices in code reviews.

What Standard Does

  • Lints JavaScript and TypeScript files against a fixed set of style rules
  • Automatically fixes most style violations with the --fix flag
  • Catches common bugs like unused variables, missing semicolons in dangerous positions, and accidental globals
  • Integrates with editors via LSP for real-time feedback
  • Works as a pre-commit hook or CI check with zero setup

Architecture Overview

Standard wraps ESLint internally with a locked-down configuration that cannot be overridden per-project. This opinionated approach means every Standard-using project shares identical style rules. The tool parses JavaScript using ESLint's AST parser and applies its rule set in a single pass, reporting violations to stdout in a human-readable format.

Self-Hosting & Configuration

  • Install via npm globally or as a dev dependency in your project
  • No config files needed — Standard works immediately after install
  • Add "standard": "*" to package.json for editor integration hints
  • Use standard --env mocha to add environment-specific globals
  • Pair with lint-staged and husky for automatic pre-commit linting

Key Features

  • Truly zero-configuration — no .eslintrc, no .prettierrc
  • Catches real bugs alongside style issues
  • Supports JSX and TypeScript via plugins
  • One command for both linting and fixing
  • Used by thousands of packages on npm for consistent open-source style

Comparison with Similar Tools

  • ESLint — Standard uses ESLint internally but removes all configuration complexity
  • Prettier — Prettier handles formatting only; Standard catches logic bugs too
  • Biome — Biome is faster (Rust-based) but requires some configuration decisions
  • XO — Similar zero-config approach but with more customization options
  • Rome (archived) — Was an all-in-one toolchain; Standard focuses purely on style enforcement

FAQ

Q: Can I override specific rules? A: No. Standard is intentionally non-configurable to eliminate style debates. If you need custom rules, use ESLint directly.

Q: Does Standard support TypeScript? A: Yes. Use ts-standard or configure the TypeScript parser to lint .ts files with the same zero-config philosophy.

Q: How does Standard differ from Prettier? A: Prettier only reformats code. Standard also catches bugs (unused vars, accidental globals) and enforces semantic patterns beyond whitespace.

Q: Is Standard still actively maintained? A: Yes. Standard tracks ESLint updates and continues to receive releases with rule improvements.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产