Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var os = require('os')
var path = require('path')
var pkgConf = require('pkg-conf')

var HOME_OR_TMP = os.homedir() || os.tmpdir()
var CACHE_HOME = require('xdg-basedir').cache || os.tmpdir()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


var DEFAULT_PATTERNS = [
'**/*.js',
Expand Down Expand Up @@ -38,8 +38,8 @@ function Linter (opts) {
var m = opts.version && opts.version.match(/^(\d+)\./)
var majorVersion = (m && m[1]) || '0'

// Example cache location: .standard-v12-cache/
var cacheLocation = path.join(HOME_OR_TMP, `.${this.cmd}-v${majorVersion}-cache/`)
// Example cache location: ~/.cache/standard/v12/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest this comment be removed. It may be understood that that is the only possible pattern.

Suggested change
// Example cache location: ~/.cache/standard/v12/

var cacheLocation = path.join(CACHE_HOME, this.cmd, `v${majorVersion}/`)

this.eslintConfig = Object.assign({
cache: true,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"deglob": "^4.0.1",
"get-stdin": "^7.0.0",
"minimist": "^1.2.5",
"pkg-conf": "^3.1.0"
"pkg-conf": "^3.1.0",
"xdg-basedir": "^4.0.0"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
Expand Down