@cloudpss/lint-staged-config 1.2.0 → 1.2.2
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/index.js +4 -2
- package/package.json +6 -4
package/index.js
CHANGED
|
@@ -5,6 +5,8 @@ const path = require('path');
|
|
|
5
5
|
const prettierSupportInfo = require('prettier').getSupportInfo();
|
|
6
6
|
const eslintCli = new (require('eslint').ESLint)({});
|
|
7
7
|
|
|
8
|
+
const DEBUG = (process.env['DEBUG'] ?? '').includes('lint-staged-config');
|
|
9
|
+
|
|
8
10
|
/** @type {readonly string[]} */
|
|
9
11
|
const prettierSupportedExt = prettierSupportInfo.languages.reduce((arr, l) => {
|
|
10
12
|
if (l.extensions) arr.push(...l.extensions);
|
|
@@ -56,10 +58,10 @@ function makeCommands(files, commands) {
|
|
|
56
58
|
*/
|
|
57
59
|
function handler(impl) {
|
|
58
60
|
return async (files) => {
|
|
59
|
-
console.log('files: ', files);
|
|
61
|
+
if (DEBUG) console.log('files: ', files);
|
|
60
62
|
try {
|
|
61
63
|
const commands = await impl(files);
|
|
62
|
-
console.log('commands: ', commands);
|
|
64
|
+
if (DEBUG) console.log('commands: ', commands);
|
|
63
65
|
return commands;
|
|
64
66
|
} catch (error) {
|
|
65
67
|
console.error(error);
|
package/package.json
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"homepage": "https://cloudpss.net/",
|
|
5
5
|
"repository": "https://codeup.aliyun.com/cloudpss/code-quality.git",
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.2",
|
|
7
7
|
"main": "./index.js",
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@types/eslint": "^8.4.10",
|
|
10
|
+
"@types/prettier": "^2.7.1"
|
|
11
|
+
},
|
|
8
12
|
"dependencies": {
|
|
9
|
-
"
|
|
10
|
-
"@types/prettier": "^2.6.3",
|
|
11
|
-
"eslint": "^8.19.0",
|
|
13
|
+
"eslint": "^8.28.0",
|
|
12
14
|
"lint-staged": "^13.0.3",
|
|
13
15
|
"prettier": "^2.7.1"
|
|
14
16
|
}
|