From 1ff2e114e2243c1e59da1f55f7b2d41405b144c5 Mon Sep 17 00:00:00 2001 From: GitCaddy Date: Tue, 13 Jan 2026 01:06:13 +0000 Subject: [PATCH] fix: use import.meta.dirname for stylelint config path resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous process.cwd() approach still failed on CI runners. Using import.meta.dirname gives us the actual directory of the config file, which is the project root, regardless of runner execution context. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- stylelint.config.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stylelint.config.ts b/stylelint.config.ts index 4f3bfd6649..9b85d3292e 100644 --- a/stylelint.config.ts +++ b/stylelint.config.ts @@ -1,11 +1,12 @@ import path from 'node:path'; import type {Config} from 'stylelint'; -// Use process.cwd() for more reliable path resolution across different environments +// Use import.meta.dirname for reliable path resolution in ESM context +// This gives us the directory where this config file lives (project root) const cssVarFiles = [ - path.join(process.cwd(), 'web_src/css/base.css'), - path.join(process.cwd(), 'web_src/css/themes/theme-gitea-light.css'), - path.join(process.cwd(), 'web_src/css/themes/theme-gitea-dark.css'), + path.join(import.meta.dirname, 'web_src/css/base.css'), + path.join(import.meta.dirname, 'web_src/css/themes/theme-gitea-light.css'), + path.join(import.meta.dirname, 'web_src/css/themes/theme-gitea-dark.css'), ]; export default {