https://github.com/tjx666/stylelint-config
my personal shareable stylelint config
https://github.com/tjx666/stylelint-config
Last synced: 27 days ago
JSON representation
my personal shareable stylelint config
- Host: GitHub
- URL: https://github.com/tjx666/stylelint-config
- Owner: tjx666
- License: mit
- Created: 2024-01-11T06:32:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-11T06:36:12.000Z (over 1 year ago)
- Last Synced: 2025-03-29T22:34:46.875Z (29 days ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @yutengjing/stylelint-config
[](https://www.npmjs.com/package/@yutengjing/stylelint-config-basic) [](https://www.npmjs.com/package/@yutengjing/stylelint-config-basic) [](https://github.com/tjx666/stylelint-config/actions/workflows/test.yml)
## Usage
### Install
**stylelint is peerDependencies**, make sure you had already installed **stylelint**.
```shell
# pnpm
pnpm add -D @yutengjing/stylelint-config-vue# npm
npm add -D @yutengjing/stylelint-config-vue# yarn
yarn add -D @yutengjing/stylelint-config-vue# bun
bun add -d @yutengjing/stylelint-config-vue
```### Integrate
add this preset to `.stylelintrc` or `.stylelintrc.mjs`
```json
{
"extends": "@yutengjing/stylelint-config-vue"
}
```or you can simply add it to `package.json`:
```json
{
"stylelint": {
"extends": "@yutengjing/stylelint-config-vue"
}
}
```> You don't need `.stylelintignore` normally as it has been provided by the preset.
### Add script for package.json
For example:
```json
{
"scripts": {
"lint": "stylelint *.{css,html,vue}",
"lint:fix": "pnpm lint -- --fix"
}
}
```### Config VSCode auto fix
Install [VS Code stylelint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-stylelint) and create `.vscode/settings.json`
```jsonc
{
"stylelint.enable": true,
"stylelint.validate": ["css", "html", "vue"],
"editor.codeActionsOnSave": {
"editor.codeActionsOnSave": {
// ...other actions
"source.fixAll.stylelint": "explicit"
}
}
}
```## Related
- [@yutengjing/eslint-config](https://github.com/tjx666/eslint-config/tree/main)
- [@yutengjing/prettier-config](https://github.com/tjx666/prettier-config/tree/main)
- [@yutengjing/tsconfig](https://github.com/tjx666/tsconfig/tree/main)