You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,21 @@
10
10
[standard-url]: https://standardjs.com
11
11
12
12
## Overview
13
+
13
14
Wrap your own eslint rules in a easy-to-use command line tool and/or a JS module.
14
15
15
16
## Install
16
-
```
17
+
18
+
```sh
17
19
npm install standard-engine
18
20
```
19
21
20
22
## Who is using `standard-engine`?
23
+
21
24
Here is a list of packages using `standard-engine`. Dive into them for ideas!
22
25
23
26
-[standard](https://standardjs.com) - JavaScript Standard Style.
24
-
-[semistandard](https://github.com/Flet/semistandard) - Its `standard` with semicolons sprinkled on top.
27
+
-[semistandard](https://github.com/Flet/semistandard) - Its `standard` with semicolons sprinkled on top.
25
28
-[happiness](https://github.com/JedWatson/happiness) - JavaScript Happiness Style (semicolons and tabs)
26
29
-[doublestandard](https://github.com/flet/doublestandard) - Require TWO semicolons at the end of every line!
27
30
-[strict-standard](https://github.com/denis-sokolov/strict-standard) - Standard Style with strict error checking.
@@ -31,24 +34,29 @@ Here is a list of packages using `standard-engine`. Dive into them for ideas!
31
34
Did you make your own? Create a pull request and we will add it to the README!
32
35
33
36
## Usage
37
+
34
38
Create the files below and fill in your own values for `options.js`.
35
39
36
-
**index.js**
40
+
### `index.js`
41
+
37
42
```js
38
43
// programmatic usage
39
44
var Linter =require('standard-engine').linter
40
45
var opts =require('./options.js')
41
46
module.exports=newLinter(opts)
42
47
```
43
48
44
-
**cli.js**
49
+
### `cli.js`
50
+
45
51
```js
46
52
#!/usr/bin/env node
47
53
48
54
var opts =require('../options.js')
49
55
require('standard-engine').cli(opts)
50
56
```
51
-
**options.js**
57
+
58
+
### `options.js`
59
+
52
60
```js
53
61
var eslint =require('eslint')
54
62
var path =require('path')
@@ -71,14 +79,17 @@ module.exports = {
71
79
72
80
Additionally an optional `parseOpts()` function can be provided. See below for details.
73
81
74
-
**eslintrc.json**
75
-
Put all your .eslintrc rules in this file. A good practice is to create an [ESLint Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) and extend it, but its not required:
82
+
### `eslintrc.json`
83
+
84
+
Put all your .eslintrc rules in this file. A good practice is to create an [ESLint Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) and extend it, but its not required:
85
+
76
86
```js
77
87
{
78
88
// pretend that the package eslint-config-pocketlint exists!
79
89
"extends": ["pocketlint"]
80
90
}
81
91
```
92
+
82
93
Take a look at [eslint-config-standard](https://github.com/feross/eslint-config-standard) as an example, or if you want to extend/mutate `standard`, see [eslint-config-semistandard](https://github.com/flet/eslint-config-semistandard).
83
94
84
95
## Editor Integrations
@@ -283,10 +294,10 @@ Modify and return `opts`, or return a new object with the options that are to be
283
294
284
295
The following options are provided in the `opts` object, and must be on the returned object:
285
296
286
-
*`ignore`: array of file globs to ignore
287
-
*`cwd`: string, the current working directory
288
-
*`fix`: boolean, whether to automatically fix problems
289
-
*`eslintConfig`: object, the options passed to [ESLint's `CLIEngine`](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)
297
+
-`ignore`: array of file globs to ignore
298
+
-`cwd`: string, the current working directory
299
+
-`fix`: boolean, whether to automatically fix problems
300
+
-`eslintConfig`: object, the options passed to [ESLint's `CLIEngine`](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)
0 commit comments