From fc305975867b807e4b7290d11941e43fb5e24258 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Wed, 25 Mar 2020 09:24:44 -0400 Subject: [PATCH] Change XO cache path to avoid conflicts when upgrading (#443) --- lib/options-manager.js | 2 +- test/options-manager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/options-manager.js b/lib/options-manager.js index c765cb54..32fdbb98 100644 --- a/lib/options-manager.js +++ b/lib/options-manager.js @@ -34,7 +34,7 @@ const { } = require('./constants'); const nodeVersion = process && process.version; -const cacheLocation = findCacheDir({name: 'xo'}) || path.join(os.homedir() || os.tmpdir(), '.xo-cache/'); +const cacheLocation = findCacheDir({name: 'xo-linter'}) || path.join(os.homedir() || os.tmpdir(), '.xo-cache/'); const DEFAULT_CONFIG = { useEslintrc: false, diff --git a/test/options-manager.js b/test/options-manager.js index e277b58a..b3719e2e 100644 --- a/test/options-manager.js +++ b/test/options-manager.js @@ -46,7 +46,7 @@ test('normalizeOptions: falsie values stay falsie', t => { test('buildConfig: defaults', t => { const config = manager.buildConfig({}); - t.regex(slash(config.cacheLocation), /[\\/]\.cache\/xo\/xo-cache.json[\\/]?$/u); + t.regex(slash(config.cacheLocation), /[\\/]\.cache\/xo-linter\/xo-cache.json[\\/]?$/u); t.is(config.useEslintrc, false); t.is(config.cache, true); t.is(config.baseConfig.extends[0], 'xo/esnext');