2
0

fix: use process.cwd() for stylelint config path resolution

Fixes stylelint configuration error on CI runners where import.meta.url
resolves to the cached node_modules location instead of the project root.

🤖 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 00:00:45 +00:00
parent f6e9e3b17d
commit 11cf6e252b

View File

@@ -1,10 +1,11 @@
import {fileURLToPath} from 'node:url';
import path from 'node:path';
import type {Config} from 'stylelint';
// Use process.cwd() for more reliable path resolution across different environments
const cssVarFiles = [
fileURLToPath(new URL('web_src/css/base.css', import.meta.url)),
fileURLToPath(new URL('web_src/css/themes/theme-gitea-light.css', import.meta.url)),
fileURLToPath(new URL('web_src/css/themes/theme-gitea-dark.css', import.meta.url)),
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'),
];
export default {
@@ -133,9 +134,9 @@ export default {
'media-feature-name-no-vendor-prefix': true,
'no-descending-specificity': null,
'no-invalid-position-at-import-rule': [true, {ignoreAtRules: ['tailwind']}],
'no-unknown-animations': null, // disabled until stylelint supports multi-file linting
'no-unknown-custom-media': null, // disabled until stylelint supports multi-file linting
'no-unknown-custom-properties': null, // disabled until stylelint supports multi-file linting
'no-unknown-animations': null,
'no-unknown-custom-media': null,
'no-unknown-custom-properties': null,
'plugin/declaration-block-no-ignored-properties': true,
'scale-unlimited/declaration-strict-value': [['/color$/', 'font-weight'], {ignoreValues: '/^(inherit|transparent|unset|initial|currentcolor|none)$/', ignoreFunctions: true, disableFix: true, expandShorthand: true}],
'selector-attribute-quotes': 'always',