File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 87
87
"eslint-import-resolver-node" : " ^0.3.2" ,
88
88
"eslint-module-utils" : " ^2.4.0" ,
89
89
"has" : " ^1.0.3" ,
90
- "lodash" : " ^4.17.11" ,
91
90
"minimatch" : " ^3.0.4" ,
92
91
"read-pkg-up" : " ^2.0.0" ,
93
92
"resolve" : " ^1.11.0"
Original file line number Diff line number Diff line change 1
1
import path from 'path'
2
2
import fs from 'fs'
3
- import { isEmpty } from 'lodash'
4
3
import readPkgUp from 'read-pkg-up'
5
4
import minimatch from 'minimatch'
6
5
import resolve from 'eslint-module-utils/resolve'
@@ -31,15 +30,15 @@ function getDependencies(context, packageDir) {
31
30
peerDependencies : { } ,
32
31
}
33
32
34
- if ( ! isEmpty ( packageDir ) ) {
33
+ if ( ! packageDir || packageDir . length === 0 ) {
35
34
if ( ! Array . isArray ( packageDir ) ) {
36
35
paths = [ path . resolve ( packageDir ) ]
37
36
} else {
38
37
paths = packageDir . map ( dir => path . resolve ( dir ) )
39
38
}
40
39
}
41
40
42
- if ( ! isEmpty ( paths ) ) {
41
+ if ( paths . length > 0 ) {
43
42
// use rule config to find package.json
44
43
paths . forEach ( dir => {
45
44
const _packageContent = extractDepFields (
@@ -70,7 +69,7 @@ function getDependencies(context, packageDir) {
70
69
71
70
return packageContent
72
71
} catch ( e ) {
73
- if ( ! isEmpty ( paths ) && e . code === 'ENOENT' ) {
72
+ if ( paths . length > 0 && e . code === 'ENOENT' ) {
74
73
context . report ( {
75
74
message : 'The package.json file could not be found.' ,
76
75
loc : { line : 0 , column : 0 } ,
You can’t perform that action at this time.
0 commit comments