File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 11---
2- sidebar_position : 4
2+ sidebar_position : 5
33---
44
55# JavaScript 规范
Original file line number Diff line number Diff line change 1+ ---
2+ sidebar_position : 4
3+ ---
4+
5+ # Tailwind CSS 规范
6+
7+ ``` js
8+ // .eslintrc.js
9+
10+ module .exports = {
11+ extends: [
12+ ' plugin:tailwindcss/recommended' ,
13+ ],
14+ };
15+ ```
16+
17+ ::: warning
18+ 截止目前 ` eslint-plugin-tailwindcss ` 需要 beta 版才支持 Tailwind CSS v4,请执行以下命令安装,并等待最终正式版
19+
20+ ``` bash
21+ pnpm add eslint-plugin-tailwindcss@beta -D
22+ ```
23+ :::
24+
25+ | 规则名称 | 错误级别 | 配置选项 | 描述 |
26+ | ---| ---| ---| ---|
27+ | [ classnames-order] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/classnames-order.md ) | warn | - | 使用基于官方推荐顺序的 Tailwind CSS 类名一致排序 |
28+ | [ enforces-negative-arbitrary-values] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/enforces-negative-arbitrary-values.md ) | warn | - | 警告使用任意值时带有 ` - ` 前缀的类名 |
29+ | [ enforces-shorthand] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/enforces-shorthand.md ) | warn | - | 将多个 Tailwind CSS 类名替换为其简写形式 |
30+ | [ migration-from-tailwind-2] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/migration-from-tailwind-2.md ) | off | - | 检测升级到 Tailwind CSS v3 时的过时类名 |
31+ | [ no-arbitrary-value] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/no-arbitrary-value.md ) | off | - | 禁止在类名中使用任意值 |
32+ | [ no-custom-classname] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/no-custom-classname.md ) | warn | - | 检测不属于 Tailwind CSS 的类名 |
33+ | [ no-contradicting-classname] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/no-contradicting-classname.md ) | off | - | 避免使用相互矛盾的Tailwind CSS类名(例如"w-3 w-5") |
34+ | [ no-unnecessary-arbitrary-value] ( https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/no-unnecessary-arbitrary-value.md ) | warn | - | 避免使用不必要的任意类名 |
You can’t perform that action at this time.
0 commit comments