# @trscd/stylelint-config-tpconfig

> Custom configuration based on stylelint

Latest version **1.1.4** (published 2025-02-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @trscd/stylelint-config-tpconfig
pnpm add @trscd/stylelint-config-tpconfig
yarn add @trscd/stylelint-config-tpconfig
bun add @trscd/stylelint-config-tpconfig
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2025-02-07 |
| First published | 2021-01-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | puyuchun |
| Maintainers | puyuchun, iamzhaoqing, hjb2722404, hxh1246996371 |
| Keywords | stylelint |

## Links

- npm: https://www.npmjs.com/package/@trscd/stylelint-config-tpconfig
- Repository: https://github.com/CDTRSFE/stylelint-config-tpconfig
- Homepage: https://github.com/CDTRSFE/stylelint-config-tpconfig#readme
- Issues: https://github.com/CDTRSFE/stylelint-config-tpconfig/issues
- npm.io page: https://npm.io/package/@trscd/stylelint-config-tpconfig

## Dependencies (8)

- [stylelint](https://npm.io/package/stylelint.md) ^14.1.0
- [postcss-html](https://npm.io/package/postcss-html.md) ^1.2.0
- [postcss-less](https://npm.io/package/postcss-less.md) ^5.0.0
- [postcss-scss](https://npm.io/package/postcss-scss.md) ^4.0.2
- [stylelint-order](https://npm.io/package/stylelint-order.md) ^5.0.0
- [stylelint-config-html](https://npm.io/package/stylelint-config-html.md) ^1.0.0
- [stylelint-config-standard](https://npm.io/package/stylelint-config-standard.md) ^23.0.0
- [stylelint-config-recommended-vue](https://npm.io/package/stylelint-config-recommended-vue.md) ^1.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2025-02-07
- 1.1.3 — 2021-11-16
- 1.1.1 — 2021-11-15
- 1.1.0 — 2021-11-12
- 1.0.1 — 2021-11-11
- 1.0.0 — 2021-11-11
- 0.0.6 — 2021-03-08
- 0.0.5 — 2021-03-08
- 0.0.4 — 2021-03-05
- 0.0.3 — 2021-01-26
- 0.0.2 — 2021-01-26

## README

# stylelint-config-tpconfig

此扩展包是基于 `stylelint-config-standard` 自定义的 `stylelint` 校验规则。

保证项目安装 `stylelint` 后进行如下操作：

## 安装

```shell
$ npm install @trscd/stylelint-config-tpconfig --save-dev
```

## 使用

在工程根目录创建一个 `stylelint.config.js` 文件，或者创建 [stylelint配置](https://stylelint.io/user-guide/configure) 允许的其他文件填写如下内容：

```javascript
// stylelint.config.js
{
    extends: '@trscd/stylelint-config-tpconfig'
}
```

根据团队内部需求，若有修改，可在后面增加 `rules` 属性自行配置。

## 自动修复

### 编辑器自动修复

需要下载对应的编辑器修复插件，以 `vscode` 举例，需要在 `vscode` 扩展工具中下载 `stylelint` 插件。Stylelint v14 默认不再检查 `html`, `vue`, `less`, `scss` 文件，需要配置插件选项 `stylelint.validate`:

```js
// vscode/settings.json

{
  "stylelint.validate": [
      ...,
      "html",
      "vue",
      "less",
      "scss"
  ]
}
```

### webpack打包修复

需要安装 [stylelint-webpack-plugin](https://webpack.docschina.org/plugins/stylelint-webpack-plugin/) ，然后在配置文件中进行对应配置。

### 命令行修复

以 `vue` 工程举例，只修复 `src` 下面的一些文件，在 `package.json` 里添加如下配置：

```json
// package.json
"scripts": {
    "stylelint": "stylelint 'src/**/*.{vue,html,css,less,scss,sass}' --fix"
}
```

## 其他

使用 `stylelint `校验规则时，若开启了编辑器自动校验修复，建议屏蔽掉编辑器自带校验规则。

---
_Source: https://npm.io/package/@trscd/stylelint-config-tpconfig · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
