https://github.com/bradoyler/metalsmith-xo
Metalsmith XO plugin
https://github.com/bradoyler/metalsmith-xo
Last synced: 18 days ago
JSON representation
Metalsmith XO plugin
- Host: GitHub
- URL: https://github.com/bradoyler/metalsmith-xo
- Owner: bradoyler
- Created: 2019-08-11T23:58:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-11T23:59:10.000Z (over 5 years ago)
- Last Synced: 2025-02-13T05:41:38.462Z (2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# metalsmith-xo
An [XO](https://github.com/sindresorhus/xo) plugin for Metalsmith that uses [metalsmith-elint](https://github.com/ubenzer/metalsmith-eslint) and [eslint-config-xo](https://github.com/sindresorhus/eslint-config-xo) underneath for a minimal config linter.
## Installation
```sh
npm install --save metalsmith-xo
```## Getting Started
If you haven't checked out [Metalsmith](http://metalsmith.io/) before, head over to their website and check out the
documentation.## Usage
```js
var xo = require('metalsmith-xo');metalsmith
.use(xo());
```## Configuration
**Enable ES2015+ features**
```js
metalsmith.use(xo('esnext'));
```**Enable browser features**
```js
metalsmith.use(xo('browser'));
```**Custom metalsmith-eslint config**
By default it will lint all `.js` files except for files in `vendor`, `bower_components`, and `node_modules`. If you wish to override these paths you can by specifying them below.
```js
var config = {
src: ['**/*.js','!ignore-this-folder/**/*.js']
}
metalsmith.use(xo('browser', config));
```You can pass `esnext` or `browser` to the function to turn on the rules you need. However, `esnext` requires some extra modules that you can read [over there](https://github.com/sindresorhus/eslint-config-xo).