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.
@@ -30,24 +33,29 @@ Here is a list of packages using `standard-engine`. Dive into them for ideas!
30
33
Did you make your own? Create a pull request and we will add it to the README!
31
34
32
35
## Usage
36
+
33
37
Create the files below and fill in your own values for `options.js`.
34
38
35
-
**index.js**
39
+
### `index.js`
40
+
36
41
```js
37
42
// programmatic usage
38
43
var Linter =require('standard-engine').linter
39
44
var opts =require('./options.js')
40
45
module.exports=newLinter(opts)
41
46
```
42
47
43
-
**cli.js**
48
+
### `cli.js`
49
+
44
50
```js
45
51
#!/usr/bin/env node
46
52
47
53
var opts =require('../options.js')
48
54
require('standard-engine').cli(opts)
49
55
```
50
-
**options.js**
56
+
57
+
### `options.js`
58
+
51
59
```js
52
60
var eslint =require('eslint')
53
61
var path =require('path')
@@ -70,14 +78,17 @@ module.exports = {
70
78
71
79
Additionally an optional `parseOpts()` function can be provided. See below for details.
72
80
73
-
**eslintrc.json**
74
-
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:
81
+
### `eslintrc.json`
82
+
83
+
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:
84
+
75
85
```js
76
86
{
77
87
// pretend that the package eslint-config-pocketlint exists!
78
88
"extends": ["pocketlint"]
79
89
}
80
90
```
91
+
81
92
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).
82
93
83
94
## Editor Integrations
@@ -282,10 +293,10 @@ Modify and return `opts`, or return a new object with the options that are to be
282
293
283
294
The following options are provided in the `opts` object, and must be on the returned object:
284
295
285
-
*`ignore`: array of file globs to ignore
286
-
*`cwd`: string, the current working directory
287
-
*`fix`: boolean, whether to automatically fix problems
288
-
*`eslintConfig`: object, the options passed to [ESLint's `CLIEngine`](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)
296
+
-`ignore`: array of file globs to ignore
297
+
-`cwd`: string, the current working directory
298
+
-`fix`: boolean, whether to automatically fix problems
299
+
-`eslintConfig`: object, the options passed to [ESLint's `CLIEngine`](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)
0 commit comments