Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Jan 16, 2020
2 parents 82bee06 + af58e6e commit e1cd6ba
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Expand Up @@ -196,6 +196,7 @@ module.exports = {
```js
// lint-staged.config.js
const micromatch = require('micromatch')

module.exports = {
'*': allFiles => {
const match = micromatch(allFiles, ['*.js', '*.ts'])
Expand All @@ -211,6 +212,7 @@ If for some reason you want to ignore files from the glob match, you can use `mi
```js
// lint-staged.config.js
const micromatch = require('micromatch')

module.exports = {
'*.js': files => {
// from `files` filter those _NOT_ matching `*test.js`
Expand All @@ -226,6 +228,7 @@ Please note that for most cases, globs can achieve the same effect. For the abov

```js
const path = require('path')

module.exports = {
'*.ts': absolutePaths => {
const cwd = process.cwd()
Expand Down Expand Up @@ -491,11 +494,12 @@ Based on the discussion from https://github.com/eslint/eslint/issues/9977 , it w

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

```
var CLIEngine = require("eslint").CLIEngine;
var cli = new CLIEngine({});
```js
const { CLIEngine } = require('eslint')

const cli = new CLIEngine({})

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

0 comments on commit e1cd6ba

Please sign in to comment.