stylelint-unocss-plugin
v0.0.1
Published
Set (in the future) of rules to extend unocss support in stylelint
Readme
stylelint-unocss-plugin
Set (in the future) of rules to extend unocss support in stylelint
Install
pnpm install stylelint-unocss-pluginnpm install stylelint-unocss-pluginyarn add stylelint-unocss-pluginUsage
Default
/** @type {import('stylelint').Config} */
export default {
plugins: ['stylelint-unocss-plugin'],
rules: {
'stylelint-unocss-plugin/no-missconfigured-theme-fn': true,
},
}With options
/** @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
Rules
no-missconfigured-theme-fn
Highlights errors, caused by utilizing absent token inside theme() functions
Normal
Error
VS Code limitations
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.
