lint-staged 11.2.5 → 11.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -105,7 +105,7 @@ Starting with v3.1 you can now use different ways of configuring lint-staged:
105
105
  - `lint-staged.config.js`, `.lintstagedrc.js`, or `.lintstagedrc.cjs` file in JS format
106
106
  - Pass a configuration file using the `--config` or `-c` flag
107
107
 
108
- See [lilconfig](https://github.com/antonk52/lilconfig) for more details on what formats are supported.
108
+ See [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) for more details on what formats are supported.
109
109
 
110
110
  Configuration should be an object where each value is a command to run and its key is a glob pattern to use for this command. This package uses [micromatch](https://github.com/micromatch/micromatch) for glob patterns.
111
111
 
package/lib/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { lilconfig } = require('lilconfig')
4
- const yaml = require('js-yaml')
3
+ const { cosmiconfig } = require('cosmiconfig')
5
4
  const debugLog = require('debug')('lint-staged')
6
5
  const stringifyObject = require('stringify-object')
7
6
 
@@ -25,10 +24,8 @@ const resolveConfig = (configPath) => {
25
24
  }
26
25
  }
27
26
 
28
- const jsYamlLoad = (filepath, content) => yaml.load(content)
29
-
30
27
  const loadConfig = (configPath) => {
31
- const explorer = lilconfig('lint-staged', {
28
+ const explorer = cosmiconfig('lint-staged', {
32
29
  searchPlaces: [
33
30
  'package.json',
34
31
  '.lintstagedrc',
@@ -40,11 +37,6 @@ const loadConfig = (configPath) => {
40
37
  'lint-staged.config.js',
41
38
  'lint-staged.config.cjs',
42
39
  ],
43
- loaders: {
44
- '.yml': jsYamlLoad,
45
- '.yaml': jsYamlLoad,
46
- noExt: jsYamlLoad,
47
- },
48
40
  })
49
41
 
50
42
  return configPath ? explorer.load(resolveConfig(configPath)) : explorer.search()
@@ -92,7 +84,7 @@ const lintStaged = async (
92
84
  ) => {
93
85
  await validateOptions({ shell }, logger)
94
86
 
95
- debugLog('Loading config using `lilconfig`')
87
+ debugLog('Loading config using `cosmiconfig`')
96
88
 
97
89
  const resolved = configObject
98
90
  ? { config: configObject, filepath: '(input)' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "11.2.5",
3
+ "version": "11.2.6",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/okonet/lint-staged",
@@ -30,11 +30,10 @@
30
30
  "cli-truncate": "2.1.0",
31
31
  "colorette": "^1.4.0",
32
32
  "commander": "^8.2.0",
33
+ "cosmiconfig": "^7.0.1",
33
34
  "debug": "^4.3.2",
34
35
  "enquirer": "^2.3.6",
35
36
  "execa": "^5.1.1",
36
- "js-yaml": "^4.1.0",
37
- "lilconfig": "^2.0.3",
38
37
  "listr2": "^3.12.2",
39
38
  "micromatch": "^4.0.4",
40
39
  "normalize-path": "^3.0.0",