@cloudpss/lint-staged-config 1.4.2 → 1.4.4

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.
Files changed (2) hide show
  1. package/index.js +10 -4
  2. package/package.json +6 -5
package/index.js CHANGED
@@ -69,7 +69,7 @@ function handler(impl) {
69
69
  };
70
70
  }
71
71
 
72
- module.exports = {
72
+ module.exports = /** @type {import('lint-staged').Config} */ ({
73
73
  '*': handler(async (files) => {
74
74
  const commands = [];
75
75
  const eslintFiles = [];
@@ -82,7 +82,10 @@ module.exports = {
82
82
  stylelintFiles.push(file);
83
83
  } else {
84
84
  const filename = path.basename(file);
85
- if (prettierSupportedFilename.includes(filename) || prettierSupportedExt.some((v) => filename.endsWith(v))) {
85
+ if (
86
+ prettierSupportedFilename.includes(filename) ||
87
+ prettierSupportedExt.some((v) => filename.endsWith(v))
88
+ ) {
86
89
  prettierFiles.push(file);
87
90
  }
88
91
  }
@@ -94,9 +97,12 @@ module.exports = {
94
97
  `eslint ${cacheOptions} --cache-location node_modules/.cache/eslint/ --fix --max-warnings 0 --no-error-on-unmatched-pattern`,
95
98
  `git add`,
96
99
  ]),
97
- ...makeCommands(stylelintFiles, [`stylelint ${cacheOptions} --cache-location node_modules/.cache/stylelint/ --fix`, `git add`]),
100
+ ...makeCommands(stylelintFiles, [
101
+ `stylelint ${cacheOptions} --cache-location node_modules/.cache/stylelint/ --fix`,
102
+ `git add`,
103
+ ]),
98
104
  ...makeCommands(prettierFiles, [`prettier ${cacheOptions} --write`, `git add`]),
99
105
  );
100
106
  return commands;
101
107
  }),
102
- };
108
+ });
package/package.json CHANGED
@@ -3,15 +3,16 @@
3
3
  "license": "MIT",
4
4
  "homepage": "https://cloudpss.net/",
5
5
  "repository": "https://codeup.aliyun.com/cloudpss/code-quality.git",
6
- "version": "1.4.2",
6
+ "version": "1.4.4",
7
7
  "main": "./index.js",
8
8
  "devDependencies": {
9
- "@types/eslint": "^8.37.0",
10
- "@types/prettier": "^2.7.2"
9
+ "@types/eslint": "^8.40.2",
10
+ "@types/lint-staged": "^13.2.0",
11
+ "@types/prettier": "^2.7.3"
11
12
  },
12
13
  "dependencies": {
13
- "eslint": "^8.39.0",
14
- "lint-staged": "^13.2.2",
14
+ "eslint": "^8.43.0",
15
+ "lint-staged": "^13.2.3",
15
16
  "prettier": "^2.8.8"
16
17
  }
17
18
  }