From 3f90a6e56a8670d08077f474abef579a8d826aa9 Mon Sep 17 00:00:00 2001 From: Rolando Bosch Date: Wed, 25 Feb 2026 01:17:58 -0800 Subject: [PATCH] Fix ESLint 10 compatibility: replace deprecated context.getFilename() ESLint 10 removed `context.getFilename()` in favor of `context.filename`. Use nullish coalescing fallback to support both ESLint 10+ and older versions. Fixes #104 Co-Authored-By: Claude Opus 4.6 --- lib/core/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/index.js b/lib/core/index.js index d41cd71..a5549da 100755 --- a/lib/core/index.js +++ b/lib/core/index.js @@ -28,7 +28,7 @@ function dashesCamelCase (str: string) { export const getFilePath = (context, styleFilePath) => { const settings = context.settings['css-modules']; - const dirName = path.dirname(context.getFilename()); + const dirName = path.dirname(context.filename ?? context.getFilename()); const basePath = (settings && settings.basePath) ? settings.basePath : ''; return styleFilePath.startsWith('.')