@cloudpss/lint-staged-config 3.0.0-rc.1 → 3.0.0
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 +3 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const DEBUG = (process.env['DEBUG'] ?? '').includes('lint-staged-config');
|
|
|
10
10
|
/**
|
|
11
11
|
* 检查文件是否是 prettier 支持的文件
|
|
12
12
|
* @param {string} f 文件路径
|
|
13
|
+
* @returns {Promise<boolean>}
|
|
13
14
|
*/
|
|
14
15
|
const isPrettierFile = async (f) => {
|
|
15
16
|
const fileInfo = await getFileInfo(f, {
|
|
@@ -22,6 +23,7 @@ const isPrettierFile = async (f) => {
|
|
|
22
23
|
/**
|
|
23
24
|
* 检查文件是否是 eslint 支持的文件
|
|
24
25
|
* @param {string} f 文件路径
|
|
26
|
+
* @returns {Promise<boolean>}
|
|
25
27
|
*/
|
|
26
28
|
const isEslintFile = async (f) => {
|
|
27
29
|
return !(await eslintCli.isPathIgnored(f));
|
|
@@ -31,6 +33,7 @@ const isEslintFile = async (f) => {
|
|
|
31
33
|
* 生成命令
|
|
32
34
|
* @param {string[]} files 文件列表
|
|
33
35
|
* @param {string[]} commands 命令列表
|
|
36
|
+
* @returns {string[]}
|
|
34
37
|
*/
|
|
35
38
|
function makeCommands(files, commands) {
|
|
36
39
|
if (files.length === 0) return [];
|
package/package.json
CHANGED