@huaiyou/hooks-git 2.2.2 → 2.2.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @huaiyou/hooks-git
2
2
 
3
+ ## 2.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix lint-staged empty config error when no linting tools installed
8
+
3
9
  ## 2.2.2
4
10
 
5
11
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -14,7 +14,7 @@ const cac__default = /*#__PURE__*/_interopDefaultCompat(cac);
14
14
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
15
15
  const picocolors__default = /*#__PURE__*/_interopDefaultCompat(picocolors);
16
16
 
17
- const version = "2.2.2";
17
+ const version = "2.2.3";
18
18
 
19
19
  const logger = {
20
20
  /**
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import { consola } from 'consola';
6
6
  import { execa } from 'execa';
7
7
  import picocolors from 'picocolors';
8
8
 
9
- const version = "2.2.2";
9
+ const version = "2.2.3";
10
10
 
11
11
  const logger = {
12
12
  /**
@@ -38,7 +38,12 @@ const createLintStagedConfig = () => {
38
38
  config["*.{css,scss,less}"] = styleScripts;
39
39
  }
40
40
  if (hasPrettier) {
41
- config["*.{html,json,md,yml,yaml}"] = ["prettier --write"];
41
+ config["*.{json,md,yml,yaml}"] = ["prettier --write"];
42
+ }
43
+ if (Object.keys(config).length === 0) {
44
+ return {
45
+ "*": ["git add"]
46
+ };
42
47
  }
43
48
  return config;
44
49
  };
@@ -34,7 +34,12 @@ const createLintStagedConfig = () => {
34
34
  config["*.{css,scss,less}"] = styleScripts;
35
35
  }
36
36
  if (hasPrettier) {
37
- config["*.{html,json,md,yml,yaml}"] = ["prettier --write"];
37
+ config["*.{json,md,yml,yaml}"] = ["prettier --write"];
38
+ }
39
+ if (Object.keys(config).length === 0) {
40
+ return {
41
+ "*": ["git add"]
42
+ };
38
43
  }
39
44
  return config;
40
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huaiyou/hooks-git",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Git hooks configuration with Husky, Commitlint and Lint-staged",
5
5
  "bin": {
6
6
  "hy-hooks-git": "./dist/cli.mjs",