From d22e011c90700cc51279345740b2e6648c442c59 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 21 Feb 2019 09:35:03 +0000 Subject: [PATCH] fix: use filename instead of full path --- lib/rules/no-cjs-in-config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rules/no-cjs-in-config.js b/lib/rules/no-cjs-in-config.js index bc2757e..35e6fb3 100644 --- a/lib/rules/no-cjs-in-config.js +++ b/lib/rules/no-cjs-in-config.js @@ -4,6 +4,8 @@ */ 'use strict' +const path = require('path') + // ------------------------------------------------------------------------------ // Rule Definition // ------------------------------------------------------------------------------ @@ -32,7 +34,7 @@ module.exports = { return { Program (node) { - const filename = context.getFilename() + const filename = path.basename(context.getFilename()) if (filename === configFile) { isNuxtConfig = true }