We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
standard
feross
Learn more about funding links in repositories.
Report abuse
1 parent 33048ae commit 6abd959Copy full SHA for 6abd959
index.js
@@ -147,13 +147,15 @@ Linter.prototype.parseOpts = function (opts) {
147
opts.eslintConfig.cwd = opts.cwd
148
opts.eslintConfig.fix = opts.fix
149
150
- var packageOpts = opts.usePackageJson
151
- ? pkgConf.sync(self.cmd, { cwd: opts.cwd })
152
- : {}
+ var packageOpts = {}
+ var rootPath = null
153
154
- var rootPath = opts.usePackageJson
155
- ? path.dirname(pkgConf.filepath(packageOpts))
156
- : null
+ if (opts.usePackageJson || opts.useGitIgnore) {
+ packageOpts = pkgConf.sync(self.cmd, { cwd: opts.cwd })
+ rootPath = path.dirname(pkgConf.filepath(packageOpts))
+ }
157
+
158
+ if (!opts.usePackageJson) packageOpts = {}
159
160
if (!packageOpts.noDefaultIgnore) {
161
addIgnore(DEFAULT_IGNORE)
0 commit comments