Set (in the future) of rules to extend unocss support in stylelint
pnpm install stylelint-unocss-pluginnpm install stylelint-unocss-pluginyarn add stylelint-unocss-plugin/** @type {import('stylelint').Config} */
export default {
plugins: ['stylelint-unocss-plugin'],
rules: {
'stylelint-unocss-plugin/no-missconfigured-theme-fn': true,
},
}/** @type {import('stylelint').Config} */
export default {
plugins: ['stylelint-unocss-plugin'],
rules: {
'stylelint-unocss-plugin/no-missconfigured-theme-fn': [
true,
{
cwd: 'path/to/projectRoot',
path: 'uno.config.ts',
},
],
},
}Currently, only cwd and path options are supported.
See: UnoCSS Config
Highlights errors, caused by utilizing absent token inside theme() functions
vscode-stylelint doesn't watch for changes in the uno file, so you'll need to restart Stylelint after changing the config.
To do this, you can press Ctrl+Shift+P and select Stylelint: Restart Stylelint Server.