@ilyasemenov/stylelint-config
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@ilyasemenov/stylelint-config

This is a reusable Stylelint config that I use in the projects that I develop or supervise.

Typically should be used together with ESLint config, see IlyaSemenov/lint-config.

Setup

Install:

pnpm add -D stylelint @ilyasemenov/stylelint-config

Create stylelint.config.js:

// @ts-check

import { defineConfig } from "@ilyasemenov/stylelint-config"

export default defineConfig()

Available options:

export default defineConfig({
  // Use tabs for indentation.
  tabs: true,

  // Use single quotes.
  quotes: "single",

  // ...and all stylelint options.
})

Command line script

Add to package.json:

{
  "scripts": {
    "lint": "eslint --fix . && stylelint --fix '**/*.{css,scss,vue}'"
  }
}

and run:

pnpm lint

Setup lint-staged

Create lint-staged.config.js:

export default {
  "*.{cjs,js,ts,json,md,yaml,toml}": "eslint --fix",
  "*.{css,scss}": "stylelint --fix",
  "*.vue": ["eslint --fix", "stylelint --fix"],
}

Readme

Keywords

none

Package Sidebar

Install

npm i @ilyasemenov/stylelint-config

Weekly Downloads

31

Version

1.1.0

License

MIT

Unpacked Size

21.9 kB

Total Files

12

Last publish

Collaborators

  • ilyasemenov