@kwai-explore/stylelint-config

[![NPM license](https://img.shields.io/npm/l/@kwai-explore/stylelint-config.svg)](https://www.npmjs.com/package/@kwai-explore/stylelint-config) [![NPM version](https://img.shields.io/npm/v/@kwai-explore/stylelint-config.svg)](https://www.npmjs.com/package

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@kwai-explore/stylelint-config
510.1.03 months ago3 months agoMinified + gzip package size for @kwai-explore/stylelint-config in KB

Readme

@kwai-explore/stylelint-config
NPM license NPM version NPM downloads NPM downloads

💿 Installation

pnpm install --save-dev stylelint @kwai-explore/stylelint-config
# or
npx install-peerdeps --pnpm --dev @kwai-explore/stylelint-config

📖 Usage

Set your .stylelintrc.cjs to:
module.exports = {
    overrides: [
        {
            files: ['**/*.(css)'],
            extends: ['@kwai-explore/stylelint-config/scss'],
        },
        {
            files: ['**/*.(scss)'],
            customSyntax: 'postcss-scss',
            extends: ['@kwai-explore/stylelint-config/scss'],
        },
        {
            files: ['**/*.(html|vue)'],
            customSyntax: 'postcss-html',
            extends: ['@kwai-explore/stylelint-config/vue'],
        },
    ],
    rules: {},
};

💻 Third party tool integrations

lintstaged

add this line to your lintstaged config
{
    // ↓ Add stylelint for css.
    "**/*.{css,scss,vue}": ["stylelint --cache --fix --allow-empty-input"]
}

Visual Studio Code integration

Use the stylelint.vscode-stylelint extension that Stylelint provides officially.
You have to configure the stylelint.validate option of the extension to check .vue files, because the extension does not check the *.vue file by default.
Example .vscode/settings.json:
{
  "stylelint.validate": [
      ...,
      // ↓ Add "vue" language.
      "vue"
  ]

🔒 License

See the LICENSE file for license rights and limitations (MIT).