Skip to content

Commit 7614716

Browse files
committed
add stylelint-define-config
1 parent e92eea6 commit 7614716

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"stylelint-config-recommended": "15.0.0",
107107
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
108108
"stylelint-declaration-strict-value": "1.10.7",
109+
"stylelint-define-config": "16.14.0",
109110
"stylelint-value-no-unknown-custom-properties": "6.0.1",
110111
"svgo": "3.3.2",
111112
"type-fest": "4.33.0",

stylelint.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @ts-check
2+
import {defineConfig} from 'stylelint-define-config';
13
import {fileURLToPath} from 'node:url';
24

35
const cssVarFiles = [
@@ -6,8 +8,7 @@ const cssVarFiles = [
68
fileURLToPath(new URL('web_src/css/themes/theme-gitea-dark.css', import.meta.url)),
79
];
810

9-
/** @type {import('stylelint').Config} */
10-
export default {
11+
export default defineConfig({
1112
extends: 'stylelint-config-recommended',
1213
plugins: [
1314
'stylelint-declaration-strict-value',
@@ -120,13 +121,15 @@ export default {
120121
'csstools/value-no-unknown-custom-properties': [true, {importFrom: cssVarFiles}],
121122
'declaration-block-no-duplicate-properties': [true, {ignore: ['consecutive-duplicates-with-different-values']}],
122123
'declaration-block-no-redundant-longhand-properties': [true, {ignoreShorthands: ['flex-flow', 'overflow', 'grid-template']}],
124+
// @ts-expect-error - https://github.com/stylelint-types/stylelint-define-config/issues/1
123125
'declaration-property-unit-disallowed-list': {'line-height': ['em']},
126+
// @ts-expect-error - https://github.com/stylelint-types/stylelint-define-config/issues/1
124127
'declaration-property-value-disallowed-list': {'word-break': ['break-word']},
125128
'font-family-name-quotes': 'always-where-recommended',
126129
'function-name-case': 'lower',
127130
'function-url-quotes': 'always',
128131
'import-notation': 'string',
129-
'length-zero-no-unit': [true, {ignore: ['custom-properties']}, {ignoreFunctions: ['var']}],
132+
'length-zero-no-unit': [true, {ignore: ['custom-properties'], ignoreFunctions: ['var']}],
130133
'media-feature-name-no-vendor-prefix': true,
131134
'no-descending-specificity': null,
132135
'no-invalid-position-at-import-rule': [true, {ignoreAtRules: ['tailwind']}],
@@ -143,4 +146,4 @@ export default {
143146
'shorthand-property-no-redundant-values': true,
144147
'value-no-vendor-prefix': [true, {ignoreValues: ['box', 'inline-box']}],
145148
},
146-
};
149+
});

0 commit comments

Comments
 (0)