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 }