@@ -102,7 +102,7 @@ string of the package:
102
102
103
103
``` json
104
104
{
105
- "standard-engine" : " semistandard "
105
+ "standard-engine" : " pocketlint "
106
106
}
107
107
```
108
108
@@ -111,7 +111,7 @@ or an object with a `name` value of the package:
111
111
``` json
112
112
{
113
113
"standard-engine" : {
114
- "name" : " semistandard "
114
+ "name" : " pocketlint "
115
115
}
116
116
}
117
117
```
@@ -128,6 +128,19 @@ projects `package.json` file.
128
128
129
129
## Engine Features
130
130
131
+ ### Extensions
132
+
133
+ The extensions ` .js ` , ` .jsx ` , ` .mjs ` , and ` .cjs ` are linted by default. If you
134
+ pass directory paths to the ` standardEngine.lintFiles() ` method,
135
+ ` standard-engine ` checks the files in those directories that have the given
136
+ extensions.
137
+
138
+ For example, when passing the ` src/ ` directory and the ` extensions ` option is
139
+ ` ['.js', '.jsx'] ` , ` standard-engine ` will lint ` *.js ` and ` *.jsx ` files in
140
+ ` src/ ` .
141
+
142
+ You can disable these default ignores by setting the ` noDefaultExensions ` option to ` true ` .
143
+
131
144
### Ignoring Files
132
145
133
146
The paths ` node_modules/** ` , ` *.min.js ` , ` coverage/** ` , hidden files/folders
@@ -152,14 +165,14 @@ Some files are ignored by default:
152
165
153
166
``` js
154
167
var DEFAULT_IGNORE = [
155
- ' **/* .min.js' ,
156
- ' coverage/** ' ,
157
- ' node_modules/** ' ,
158
- ' vendor/** '
168
+ ' *.min.js' ,
169
+ ' coverage/' ,
170
+ ' node_modules/' ,
171
+ ' vendor/'
159
172
]
160
173
```
161
174
162
- You can disable these default ignores by setting ` noDefaultIgnore ` option to ` true ` .
175
+ You can disable these default ignores by setting the ` noDefaultIgnore ` option to ` true ` .
163
176
164
177
### Hiding Warnings
165
178
@@ -294,7 +307,7 @@ Modify and return `opts`, or return a new object with the options that are to be
294
307
295
308
The following options are provided in the ` opts ` object, and must be on the returned object:
296
309
297
- - ` ignore ` : array of file globs to ignore
310
+ - ` ignore ` : array of file patterns (in ` .gitignore ` format) to ignore
298
311
- ` cwd ` : string, the current working directory
299
312
- ` fix ` : boolean, whether to automatically fix problems
300
313
- ` eslintConfig ` : object, the options passed to [ ESLint's ` CLIEngine ` ] ( http://eslint.org/docs/developer-guide/nodejs-api#cliengine )
@@ -308,14 +321,19 @@ be provided:
308
321
309
322
``` js
310
323
{
311
- cwd : ' ' , // current working directory (default: process.cwd())
324
+ // unique to lintText
312
325
filename: ' ' , // path of file containing the text being linted
326
+
327
+ // common to lintText and lintFiles
328
+ cwd: ' ' , // current working directory (default: process.cwd())
313
329
fix: false , // automatically fix problems
330
+ extensions: [], // file extensions to lint (has sane defaults)
314
331
globals: [], // custom global variables to declare
315
332
plugins: [], // custom eslint plugins
316
333
envs: [], // custom eslint environment
317
334
parser: ' ' , // custom js parser (e.g. babel-eslint)
318
- usePackageJson: true // use options from nearest package.json?
335
+ usePackageJson: true , // use options from nearest package.json?
336
+ useGitIgnore: true // use file ignore patterns from .gitignore?
319
337
}
320
338
```
321
339
@@ -356,20 +374,25 @@ Lint the provided `files` globs. An `opts` object may be provided:
356
374
357
375
``` js
358
376
{
377
+ // unique to lintFiles
359
378
ignore: [], // file globs to ignore (has sane defaults)
379
+
380
+ // common to lintText and lintFiles
360
381
cwd: ' ' , // current working directory (default: process.cwd())
361
382
fix: false , // automatically fix problems
383
+ extensions: [], // file extensions to lint (has sane defaults)
362
384
globals: [], // custom global variables to declare
363
385
plugins: [], // custom eslint plugins
364
386
envs: [], // custom eslint environment
365
387
parser: ' ' , // custom js parser (e.g. babel-eslint)
366
- usePackageJson: true // use options from nearest package.json?
388
+ usePackageJson: true , // use options from nearest package.json?
389
+ useGitIgnore: true // use file ignore patterns from .gitignore?
367
390
}
368
391
```
369
392
370
393
Additional options may be loaded from a ` package.json ` if it's found for the current working directory. See below for further details.
371
394
372
- Both ` ignore ` and ` files ` globs are resolved relative to the current working directory.
395
+ Both ` ignore ` and ` files ` patterns are resolved relative to the current working directory.
373
396
374
397
The ` callback ` will be called with an ` Error ` and ` results ` object (same as above).
375
398
@@ -381,7 +404,7 @@ This is the full set of options accepted by the above APIs. Not all options make
381
404
382
405
``` js
383
406
{
384
- ignore: [], // file globs to ignore (has sane defaults)
407
+ ignore: [], // file patterns to ignore (has sane defaults)
385
408
cwd: ' ' , // current working directory (default: process.cwd())
386
409
filename: ' ' , // path of the file containing the text being linted (optional)
387
410
fix: false , // automatically fix problems
0 commit comments