Skip to content

v5.0.0

Compare
Choose a tag to compare
@okonet okonet released this 11 Nov 08:24
· 631 commits to master since this release

5.0.0 (2017-11-11)

Features

  • Remove gitDir option and resolve it automatically (#327) (0ed5135), closes #271

BREAKING CHANGES

  • gitDir option deprecated and will be ignored. Additionally, glob patterns for linters should not be relative to the git root directory.

Consider a project with the following file structure:

`-- packages
    |-- prj
    |   |-- package.json
    |   |-- src
    |   |   `-- index.js
    |   `-- yarn.lock
    `-- prj-2
        `-- file

With lint-staged@4.3.0, the config would need to be something like this:

gitDir: ../..
linters:
  packages/prj/src/*.js:
    - eslint --fix
    - git add

With lint-staged@5, this simplifies to:

linters:
  src/*.js:
    - eslint --fix
    - git add
diff view
@@ -1,5 +1,4 @@
-gitDir: ../..
 linters:
-  packages/prj/src/*.js:
+  src/*.js:
     - eslint --fix
     - git add