xo 介绍
rOpinionated but con fig urable ESLint wrapper with lots of goodies included. Enforces strict and readable code. Never dis cuss code style on a pull request again! No decision-making. No .es lintr c or .jshintrc to manage. It just works!?
Uses ESLint underneath,so issues regarding rules should be opened over there.?
jsX is supported by default,but you'll need eslint-con fig -xo-react for react specific linting.
安装
npm install --global xo
Usage
$ xo --help
Usage
$ xo [<file|glob> ...]
Options
--init Add XO to your project
--fix Automagically fix issues
--reporter Reporter to use
--env Environment preset [Can be set multiple times]
--global Global variable [Can be set multiple times]
--ig nor e Additional paths to ig nor e [Can be set multiple times]
--space Use space indent instead of tabs [Default: 2]
--no-semicolon Prevent use of semicolons
--prettier Conform to Prettier code style
--node-version Range of Node.js version to support
--plugin Include third-party plugins [Can be set multiple times]
--extend Extend defaults with a custom con fig [Can be set multiple times]
--open Open files with issues in your editor
--quiet Show only errors and no warnings
--extension Additional extension to lint [Can be set multiple times]
--no-esnext Don't enforce ES2015+ rules
--cwd=<dir> Working directory for files
--stdin Validate/fix code from stdin
--stdin-filename Specify a filename for the --stdin option
Examples
$ xo
$ xo index.js
$ xo *.js !foo.js
$ xo --space
$ xo --env=node --env=mocha
$ xo --init --space
$ xo --plugin=react
$ xo --plugin=html --extension=html
$ echo 'const x=true' | xo --stdin --fix
Tips
Put options in package.json instead of using flags so other tools can read it.
GitHub: https://github.com/xojs/xo
网站描述: JavaScript happi nes s style linte
xo官方网站
官方网站:
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。