Skip to content

Commit b15efaf

Browse files
committed
Respect XDG Basedir Spec for cache location
1 parent fa7b3f2 commit b15efaf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var os = require('os')
77
var path = require('path')
88
var pkgConf = require('pkg-conf')
99

10-
var HOME_OR_TMP = os.homedir() || os.tmpdir()
10+
var CACHE_HOME = require('xdg-basedir').cache || os.tmpdir()
1111

1212
var DEFAULT_PATTERNS = [
1313
'**/*.js',
@@ -39,7 +39,7 @@ function Linter (opts) {
3939
var majorVersion = (m && m[1]) || '0'
4040

4141
// Example cache location: .standard-v12-cache/
42-
var cacheLocation = path.join(HOME_OR_TMP, `.${this.cmd}-v${majorVersion}-cache/`)
42+
var cacheLocation = path.join(CACHE_HOME, this.cmd, `v${majorVersion}/`)
4343

4444
this.eslintConfig = Object.assign({
4545
cache: true,

0 commit comments

Comments
 (0)