Skip to content

Commit e1cd6ba

Browse files
authored
Merge branch 'master' into beta
2 parents 82bee06 + af58e6e commit e1cd6ba

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ module.exports = {
196196
```js
197197
// lint-staged.config.js
198198
const micromatch = require('micromatch')
199+
199200
module.exports = {
200201
'*': allFiles => {
201202
const match = micromatch(allFiles, ['*.js', '*.ts'])
@@ -211,6 +212,7 @@ If for some reason you want to ignore files from the glob match, you can use `mi
211212
```js
212213
// lint-staged.config.js
213214
const micromatch = require('micromatch')
215+
214216
module.exports = {
215217
'*.js': files => {
216218
// from `files` filter those _NOT_ matching `*test.js`
@@ -226,6 +228,7 @@ Please note that for most cases, globs can achieve the same effect. For the abov
226228

227229
```js
228230
const path = require('path')
231+
229232
module.exports = {
230233
'*.ts': absolutePaths => {
231234
const cwd = process.cwd()
@@ -491,11 +494,12 @@ Based on the discussion from https://github.com/eslint/eslint/issues/9977 , it w
491494

492495
So you can setup a `.lintstagedrc.js` config file to do this:
493496

494-
```
495-
var CLIEngine = require("eslint").CLIEngine;
496-
var cli = new CLIEngine({});
497+
```js
498+
const { CLIEngine } = require('eslint')
499+
500+
const cli = new CLIEngine({})
497501

498502
module.exports = {
499-
"*.js": files => 'eslint --max-warnings=0 ' + files.filter( file => ! cli.isPathIgnored( file ) ).join( ' ' ),
503+
'*.js': files => 'eslint --max-warnings=0 ' + files.filter( file => ! cli.isPathIgnored( file ) ).join( ' ' )
500504
}
501505
```

0 commit comments

Comments
 (0)