Ref. standardjs.com/readme-en.html
** 이거 좋으다.
JavaScript Standard Style
English • Español (Latinoamérica) • Français • Bahasa Indonesia • Italiano (Italian) • 日本語 (Japanese) • 한국어 (Korean) • Português (Brasil) • 简体中文 (Simplified Chinese) • 繁體中文 (Taiwanese Mandarin)
JavaScript style guide, linter, and formatter
This module saves you (and others!) time in three ways:
- No configuration. The easiest way to enforce code quality in your project. No decisions to make. No .eslintrc files to manage. It just works.
- Automatically format code. Just run standard --fix and say goodbye to messy or inconsistent code.
- Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor.
Give it a try by running npx standard --fix right now!
Table of Contents
- Quick start
- FAQ
- Why should I use JavaScript Standard Style?
- Who uses JavaScript Standard Style?
- Are there text editor plugins?
- Is there a readme badge?
- I disagree with rule X, can you change it?
- But this isn't a real web standard!
- Is there an automatic formatter?
- How do I ignore files?
- How do I disable a rule?
- I use a library that pollutes the global namespace. How do I prevent "variable is not defined" errors?
- How do I use experimental JavaScript (ES Next) features?
- Can I use a JavaScript language variant, like Flow or TypeScript?
- What about Mocha, Jest, Jasmine, QUnit, etc?
- What about Web Workers and Service Workers?
- What is the difference between warnings and errors?
- Can I check code inside of Markdown or HTML files?
- Is there a Git pre-commit hook?
- How do I make the output all colorful and pretty?
- Is there a Node.js API?
- How do I contribute to StandardJS?
Install
The easiest way to use JavaScript Standard Style is to install it globally as a Node command line program. Run the following command in Terminal:
$ npm install standard --global
Or, you can install standard locally, for use in a single project:
$ npm install standard --save-dev
Note: To run the preceding commands, Node.js and npm must be installed.
Usage
After you've installed standard, you should be able to use the standard program. The simplest use case would be checking the style of all JavaScript files in the current working directory:
$ standard Error: Use JavaScript Standard Style lib/torrent.js:950:11: Expected '===' and instead saw '=='.
If you've installed standard locally, run with npx instead:
$ npx standard
You can optionally pass in a directory (or directories) using the glob pattern. Be sure to quote paths containing glob patterns so that they are expanded by standard instead of your shell:
$ standard "src/util/**/*.js" "test/**/*.js"
Note: by default standard will look for all files matching the patterns: **/*.js, **/*.jsx.
'Programming > JavaScript, Node.js' 카테고리의 다른 글
Node.js vs Java: What to Choose in 2021? (0) | 2021.05.19 |
---|---|
Express 4.16.0 - Release date: 2017-09-28 (0) | 2021.05.12 |
AWS Lambda function handler in Node.js (0) | 2021.05.12 |
How To Use JSON Web Tokens (JWTs) in Express.js (0) | 2021.03.31 |
Handling those unhandled promise rejections with JS async/await (0) | 2021.02.04 |
댓글