Socket
Book a DemoInstallSign in
Socket

stylelint-unocss-plugin

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-unocss-plugin

Set (in the future) of rules to extend unocss support in stylelint

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
24
-41.46%
Maintainers
0
Weekly downloads
 
Created
Source

stylelint-unocss-plugin

Set (in the future) of rules to extend unocss support in stylelint

Install

pnpm install stylelint-unocss-plugin
npm install stylelint-unocss-plugin
yarn add stylelint-unocss-plugin

Usage

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

image

Error

image

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.

FAQs

Package last updated on 21 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts