lint-staged 12.2.0 → 12.2.1

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.
@@ -56,10 +56,7 @@ export const getConfigGroups = async ({ configObject, configPath, files }, logge
56
56
  Object.entries(filesByDir).map(([dir, files]) => {
57
57
  // Discover config from the base directory of the file
58
58
  return loadConfig({ cwd: dir }, logger).then(({ config, filepath }) => {
59
- if (!config) {
60
- logger.error(`${ConfigNotFoundError.message}.`)
61
- throw ConfigNotFoundError
62
- }
59
+ if (!config) return
63
60
 
64
61
  if (filepath in configGroups) {
65
62
  // Re-use cached config and skip validation
@@ -73,5 +70,11 @@ export const getConfigGroups = async ({ configObject, configPath, files }, logge
73
70
  })
74
71
  )
75
72
 
73
+ // Throw if no configurations were found
74
+ if (Object.keys(configGroups).length === 0) {
75
+ logger.error(`${ConfigNotFoundError.message}.`)
76
+ throw ConfigNotFoundError
77
+ }
78
+
76
79
  return configGroups
77
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "12.2.0",
3
+ "version": "12.2.1",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/okonet/lint-staged",