Skip to content

Commit

Permalink
fix: fix lint rule (#96)
Browse files Browse the repository at this point in the history
* chore: add test code

* chore: add test code

* chore: improve code coverage to 95%

* fix: when install p plugin in devDependencies cant use plugin

* fix: change package.json main file

* fix: fix eslint check

* fix: add some pkg

* fix: fix lint rule

* fix: penetrate lint err code to process
  • Loading branch information
Stevenzwzhai authored and cpselvis committed May 30, 2019
1 parent c113162 commit 39e3aa5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/internal/lint/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
const path = require('path');
const spawn = require('cross-spawn');
const Loading = require('../../utils/index').Loading;

const exec = require('child_process').exec;

const sgf = require('staged-git-files');
const pify = require('pify');
const findParentDir = require('find-parent-dir');

const jsFilesFilter = (files) => {
return files.filter(filepath => /\.js$/.test(filepath))
// filter js file
function jsFilesFilter (files){
return files.filter(filepath => /\.js$/.test(filepath));
}


// get stage files
function getStageFiles(cb) {
const gitDir = findParentDir.sync(process.cwd(), '.git');
Expand Down Expand Up @@ -66,7 +64,7 @@ function getCommitDiffFiles(cb) {
console.log('err:', err)
console.log('stderr:', stderr)
} else {
const typeList = ['M', 'D', 'A']
const typeList = ['A', 'C', 'M'];
let arr;
typeList.forEach(type => {
arr = getArrList(stdout, type)
Expand Down Expand Up @@ -133,6 +131,7 @@ class Linter {
loading.success('lint complete');
} else {
loading.fail(`code get errors or warnings`);
process.exit(code);
}
});
}
Expand Down

0 comments on commit 39e3aa5

Please sign in to comment.