Linux command
standard 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Check code
standard
Fix automatically
standard --fix
Check specific files
standard [file1.js] [file2.js]
Use parser
standard --parser [babel-eslint]
Verbose output
standard --verbose
Declare globals
standard --global [globalName]
说明
standard is a zero-configuration JavaScript linter and formatter that enforces a fixed set of style rules. Built on top of ESLint, it eliminates the need for project-specific .eslintrc files by providing a single, opinionated style guide that includes rules like no semicolons, 2-space indentation, and single quotes. The --fix flag automatically corrects fixable issues in place. The tool can lint files passed as arguments or recursively scan the current directory. Custom parsers like babel-eslint can be specified for projects using experimental JavaScript syntax.
参数
- --fix
- Auto-fix issues.
- --parser _NAME_
- Custom parser.
- --verbose
- Show rule names.
- --global _NAME_
- Declare a global variable (can be repeated).
- --plugin _NAME_
- Include an ESLint plugin.
- --fix-dry-run
- Report what would be fixed without writing changes.
- --env _ENV_
- Environment globals.
- --stdin
- Lint from stdin.
FAQ
What is the standard command used for?
standard is a zero-configuration JavaScript linter and formatter that enforces a fixed set of style rules. Built on top of ESLint, it eliminates the need for project-specific .eslintrc files by providing a single, opinionated style guide that includes rules like no semicolons, 2-space indentation, and single quotes. The --fix flag automatically corrects fixable issues in place. The tool can lint files passed as arguments or recursively scan the current directory. Custom parsers like babel-eslint can be specified for projects using experimental JavaScript syntax.
How do I run a basic standard example?
Run `standard` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --fix do in standard?
Auto-fix issues.