File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ var os = require('os')
77var path = require ( 'path' )
88var 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
1212var DEFAULT_PATTERNS = [
1313 '**/*.js' ,
@@ -38,8 +38,8 @@ function Linter (opts) {
3838 var m = opts . version && opts . version . match ( / ^ ( \d + ) \. / )
3939 var majorVersion = ( m && m [ 1 ] ) || '0'
4040
41- // Example cache location: . standard- v12-cache /
42- var cacheLocation = path . join ( HOME_OR_TMP , `. ${ this . cmd } - v${ majorVersion } -cache /`)
41+ // Example cache location: ~/.cache/ standard/ v12/
42+ var cacheLocation = path . join ( CACHE_HOME , this . cmd , ` v${ majorVersion } /`)
4343
4444 this . eslintConfig = Object . assign ( {
4545 cache : true ,
Original file line number Diff line number Diff line change 3737 "deglob" : " ^4.0.1" ,
3838 "get-stdin" : " ^8.0.0" ,
3939 "minimist" : " ^1.2.5" ,
40- "pkg-conf" : " ^3.1.0"
40+ "pkg-conf" : " ^3.1.0" ,
41+ "xdg-basedir" : " ^4.0.0"
4142 },
4243 "devDependencies" : {
4344 "babel-eslint" : " ^10.1.0" ,
You can’t perform that action at this time.
0 commit comments