Skip to content

Commit

Permalink
fix: some blank file error
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxudong13804 committed Feb 20, 2024
1 parent 11ad643 commit 2770dcd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ async function lintFiles(filePaths) {
// 统计进行lint的代码行数
let filePathsStr = fileGroups[fileType].join(' ');
// console.log(fileGroups[fileType])
let stdout = execSync(`cloc --json ${filePathsStr}`).toString();
// console.log(stdout)
// let stdout = execSync(`cloc --json ${filePathsStr}`).toString();
// console.log('wow\n', JSON.parse(stdout))

totalBlankLines += JSON.parse(stdout)['SUM']['blank']
totalCommentLines += JSON.parse(stdout)['SUM']['comment']
totalCodeLines += JSON.parse(stdout)['SUM']['code']
let stdout = execSync(`cloc --json ${filePathsStr}`).toString();
totalBlankLines += JSON.parse(stdout)['SUM']?.blank || 0
totalCommentLines += JSON.parse(stdout)['SUM']?.comment || 0
totalCodeLines += JSON.parse(stdout)['SUM']?.code || 0

}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@afuteam/eslint-plugin-fe",
"version": "2.0.5-beta.5",
"version": "2.0.5-beta.6",
"description": "AfuTeam ESLint Plugin",
"main": "./lib/index.js",
"exports": {
Expand Down
Empty file added tests/blank.js
Empty file.

0 comments on commit 2770dcd

Please sign in to comment.