2
0

fix: use import.meta.dirname for stylelint config path resolution

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 <noreply@anthropic.com>
This commit is contained in:
GitCaddy
2026-01-13 01:06:13 +00:00
parent 2e718a1053
commit 1ff2e114e2

View File

@@ -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 {