|
1 | | -<!-- This file is built by build-readme.js. Do not edit it directly; edit README.md.template instead. --> |
2 | | -<br> |
3 | | -<div align="center"> |
4 | | - |
5 | | -<p align="center"> |
6 | | - <a href="https://panda-css.com"> |
7 | | - <picture> |
8 | | - <img alt="Panda CSS" src="https://github.com/chakra-ui/eslint-plugin-panda/raw/main/.github/banner.png" width="100%"> |
9 | | - </picture> |
10 | | - </a> |
11 | | -</p> |
12 | | -<p align="center">ESLint plugin for Panda CSS</p> |
13 | | - |
14 | | -<p align="center"> |
15 | | - <a aria-label="Github Actions" href="https://github.com/chakra-ui/eslint-plugin-panda/actions/workflows/quality.yml"> |
16 | | - <picture> |
17 | | - <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/chakra-ui/eslint-plugin-panda/quality.yml?branch=main&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge"> |
18 | | - <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/chakra-ui/eslint-plugin-panda/quality.yml?branch=main&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000"> |
19 | | - <img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/chakra-ui/eslint-plugin-panda/quality.yml?branch=main&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000"> |
20 | | - </picture> |
21 | | - </a> |
22 | | -</p> |
23 | | - |
24 | | -</div> |
25 | | - |
26 | | -## Getting Started |
27 | | - |
28 | | -### Installation |
29 | | - |
30 | | -```bash |
31 | | -pnpm add -D @pandacss/eslint-plugin |
32 | | -``` |
33 | | - |
34 | | -### Usage |
35 | | - |
36 | | -Add `@pandacss/eslint-plugin` to the plugins section of your `.eslintrc` configuration file. You can omit the |
37 | | -`/eslint-plugin` suffx: |
38 | | - |
39 | | -```json |
40 | | -{ |
41 | | - "plugins": ["@pandacss"] |
42 | | -} |
43 | | -``` |
44 | | - |
45 | | -Then configure the rules you want to use under the rules section. |
46 | | - |
47 | | -```json |
48 | | -{ |
49 | | - "rules": { |
50 | | - "@pandacss/no-debug": "error" |
51 | | - } |
52 | | -} |
53 | | -``` |
54 | | - |
55 | | -You can also enable the `recommended` rules in extends: |
56 | | - |
57 | | -```diff |
58 | | -{ |
59 | | -- "plugins": ["@pandacss"] |
60 | | -+ "extends": ["plugin:@pandacss/recommended"] |
61 | | -} |
62 | | -``` |
63 | | - |
64 | | -Or enable all rules in extends: |
65 | | - |
66 | | -```diff |
67 | | -{ |
68 | | -- "plugins": ["@pandacss"] |
69 | | -+ "extends": ["plugin:@pandacss/all"] |
70 | | -} |
71 | | -``` |
72 | | - |
73 | | -> [!WARNING] |
74 | | -> This is not recommended. You should only enable the rules you need. |
75 | | -
|
76 | | -## Rules |
77 | | - |
78 | | -Where rules are included in the configs `recommended`, or `all` it is indicated below. |
79 | | - |
80 | | -* [`@pandacss/file-not-included`](docs/rules/file-not-included.md) `all`, `recommended` |
81 | | -* [`@pandacss/no-config-function-in-source`](docs/rules/no-config-function-in-source.md) `all`, `recommended` |
82 | | -* [`@pandacss/no-debug`](docs/rules/no-debug.md) `all`, `recommended` |
83 | | -* [`@pandacss/no-dynamic-styling`](docs/rules/no-dynamic-styling.md) `all`, `recommended` |
84 | | -* [`@pandacss/no-escape-hatch`](docs/rules/no-escape-hatch.md) `all` |
85 | | -* [`@pandacss/no-hardcoded-color`](docs/rules/no-hardcoded-color.md) `all` |
86 | | -* [`@pandacss/no-invalid-token-paths`](docs/rules/no-invalid-token-paths.md) `all`, `recommended` |
87 | | -* [`@pandacss/no-property-renaming`](docs/rules/no-property-renaming.md) `all`, `recommended` |
88 | | -* [`@pandacss/no-shorthand-prop`](docs/rules/no-shorthand-prop.md) `all` |
89 | | -* [`@pandacss/no-unsafe-token-fn-usage`](docs/rules/no-unsafe-token-fn-usage.md) `all` |
90 | | -* [`@pandacss/prefer-atomic-properties`](docs/rules/prefer-atomic-properties.md) `all` |
91 | | - |
92 | | -## Settings |
93 | | - |
94 | | -### `configPath` |
95 | | - |
96 | | -You can tell `eslint` to use a custom panda config file by setting the `configPath` option in your `.eslintrc.js` file. |
97 | | - |
98 | | -By default we find the nearest panda config to the linted file. |
99 | | - |
100 | | -```js filename=".eslintrc.(c)js" |
101 | | -const path = require('path') |
102 | | - |
103 | | -module.exports = { |
104 | | - plugins: ['@pandacss'], |
105 | | - settings: { |
106 | | - '@pandacss/configPath': path.join('PATH-TO/panda.config.js'), |
107 | | - }, |
108 | | -} |
109 | | -``` |
| 1 | +<!-- This file is built by build-readme.js. Do not edit it directly; edit README.md.template instead. --> |
| 2 | +<br> |
| 3 | +<div align="center"> |
| 4 | + |
| 5 | +<p align="center"> |
| 6 | + <a href="https://panda-css.com"> |
| 7 | + <picture> |
| 8 | + <img alt="Panda CSS" src="https://github.com/chakra-ui/eslint-plugin-panda/raw/main/.github/banner.png" width="100%"> |
| 9 | + </picture> |
| 10 | + </a> |
| 11 | +</p> |
| 12 | +<p align="center">ESLint plugin for Panda CSS</p> |
| 13 | + |
| 14 | +<p align="center"> |
| 15 | + <a aria-label="Github Actions" href="https://github.com/chakra-ui/eslint-plugin-panda/actions/workflows/quality.yml"> |
| 16 | + <picture> |
| 17 | + <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/chakra-ui/eslint-plugin-panda/quality.yml?branch=main&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge"> |
| 18 | + <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/chakra-ui/eslint-plugin-panda/quality.yml?branch=main&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000"> |
| 19 | + <img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/chakra-ui/eslint-plugin-panda/quality.yml?branch=main&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000"> |
| 20 | + </picture> |
| 21 | + </a> |
| 22 | +</p> |
| 23 | + |
| 24 | +</div> |
| 25 | + |
| 26 | +## Getting Started |
| 27 | + |
| 28 | +### Installation |
| 29 | + |
| 30 | +```bash |
| 31 | +pnpm add -D @pandacss/eslint-plugin |
| 32 | +``` |
| 33 | + |
| 34 | +### Usage |
| 35 | + |
| 36 | +Add `@pandacss/eslint-plugin` to the plugins section of your `.eslintrc` configuration file. You can omit the |
| 37 | +`/eslint-plugin` suffx: |
| 38 | + |
| 39 | +```json |
| 40 | +{ |
| 41 | + "plugins": ["@pandacss"] |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +Then configure the rules you want to use under the rules section. |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "rules": { |
| 50 | + "@pandacss/no-debug": "error" |
| 51 | + } |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +You can also enable the `recommended` rules in extends: |
| 56 | + |
| 57 | +```diff |
| 58 | +{ |
| 59 | +- "plugins": ["@pandacss"] |
| 60 | ++ "extends": ["plugin:@pandacss/recommended"] |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +Or enable all rules in extends: |
| 65 | + |
| 66 | +```diff |
| 67 | +{ |
| 68 | +- "plugins": ["@pandacss"] |
| 69 | ++ "extends": ["plugin:@pandacss/all"] |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +> [!WARNING] |
| 74 | +> This is not recommended. You should only enable the rules you need. |
| 75 | +
|
| 76 | +## Rules |
| 77 | + |
| 78 | +Where rules are included in the configs `recommended`, or `all` it is indicated below. |
| 79 | + |
| 80 | +- [`@pandacss/file-not-included`](docs/rules/file-not-included.md) `all`, `recommended` |
| 81 | +- [`@pandacss/no-config-function-in-source`](docs/rules/no-config-function-in-source.md) `all`, `recommended` |
| 82 | +- [`@pandacss/no-debug`](docs/rules/no-debug.md) `all`, `recommended` |
| 83 | +- [`@pandacss/no-dynamic-styling`](docs/rules/no-dynamic-styling.md) `all`, `recommended` |
| 84 | +- [`@pandacss/no-escape-hatch`](docs/rules/no-escape-hatch.md) `all` |
| 85 | +- [`@pandacss/no-hardcoded-color`](docs/rules/no-hardcoded-color.md) `all` |
| 86 | +- [`@pandacss/no-invalid-token-paths`](docs/rules/no-invalid-token-paths.md) `all`, `recommended` |
| 87 | +- [`@pandacss/no-property-renaming`](docs/rules/no-property-renaming.md) `all`, `recommended` |
| 88 | +- [`@pandacss/prefer-longhand-properties`](docs/rules/prefer-longhand-properties.md) `all` |
| 89 | +- [`@pandacss/prefer-shorthand-properties`](docs/rules/prefer-shorthand-properties.md) `all` |
| 90 | +- [`@pandacss/no-unsafe-token-fn-usage`](docs/rules/no-unsafe-token-fn-usage.md) `all` |
| 91 | +- [`@pandacss/prefer-atomic-properties`](docs/rules/prefer-atomic-properties.md) `all` |
| 92 | + |
| 93 | +## Settings |
| 94 | + |
| 95 | +### `configPath` |
| 96 | + |
| 97 | +You can tell `eslint` to use a custom panda config file by setting the `configPath` option in your `.eslintrc.js` file. |
| 98 | + |
| 99 | +By default we find the nearest panda config to the linted file. |
| 100 | + |
| 101 | +```js filename=".eslintrc.(c)js" |
| 102 | +const path = require('path') |
| 103 | + |
| 104 | +module.exports = { |
| 105 | + plugins: ['@pandacss'], |
| 106 | + settings: { |
| 107 | + '@pandacss/configPath': path.join('PATH-TO/panda.config.js'), |
| 108 | + }, |
| 109 | +} |
| 110 | +``` |
0 commit comments