@kashi-ui/stylelint-plugin 0.0.0-stage → 2.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kashi contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # @kashi-ui/stylelint-plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ لینت راست‌به‌چپ و متن فارسی برای Stylelint 16 تا 18. خاصیت‌ها و مقدارهای فیزیکی CSS را به معادل منطقی تبدیل می‌کند، طوری که ظاهر فعلی در جهت اصلی پروژه حفظ شود (در پروژهٔ راست‌به‌چپ `margin-left` ← `margin-inline-end`). برای هر پروژهٔ فارسی، با [کاشی](https://kashi.sepantapouya.com) یا بدون آن.
4
+
5
+ راهنمای کامل: [kashi.sepantapouya.com/docs/lint](https://kashi.sepantapouya.com/docs/lint/)
6
+
7
+ ```bash
8
+ npm i -D @kashi-ui/stylelint-plugin
9
+ ```
10
+
11
+ ```js
12
+ // stylelint.config.mjs
13
+ export default {
14
+ extends: ["@kashi-ui/stylelint-plugin/config"],
15
+ // سخت‌گیرتر: "@kashi-ui/stylelint-plugin/strict"
16
+ // پروژه‌های کاشی، کنار یکی از بالایی‌ها: "@kashi-ui/stylelint-plugin/kashi"
17
+ };
18
+ ```
19
+
20
+ ## قانون‌ها
21
+
22
+ | قانون | چه می‌گیرد | اصلاح |
23
+ | --- | --- | --- |
24
+ | `kashi/use-logical-properties` | `margin-left`، `left`، `border-top-left-radius`، shorthand چهارمقداری نامتقارن | خودکار |
25
+ | `kashi/use-logical-values` | `text-align`، `float` و `clear` با left/right | خودکار |
26
+ | `kashi/no-physical-transform` | `translateX` و `translate` افقی بی قرینهٔ جهت | — |
27
+ | `kashi/no-root-direction` | `direction: rtl` روی `html`، `body` یا `:root` به‌جای attribute `dir` | — |
28
+ | `kashi/tailwind-logical` | کلاس‌های فیزیکی Tailwind در `@apply` | خودکار |
29
+ | `kashi/persian-text` | «ي/ك»، ارقام، نیم‌فاصله و علامت‌ها در `content` و `quotes` | خودکار |
30
+ | `kashi/persian-typography` | `letter-spacing` مثبت و ایتالیک روی متن فارسی (فقط strict) | — |
31
+ | `kashi/use-tokens` | رنگ و اندازهٔ ثابتی که توکن کاشی دارد | — |
32
+ | `kashi/no-unknown-token` | `var(--k-…)` با نامی که در کاشی نیست | — |
33
+
34
+ وسط‌چینی (`left: 50%` با `translate(-50%)`)، قاعده‌های `:dir()` و `[dir]`، selectorی که سمت را نام می‌برد (`[data-side="left"]`)، بلوک‌های کد و مختصات JS (`left: var(--_x)`) دست نمی‌خورند.
35
+
36
+ ## گزینه‌های مشترک
37
+
38
+ ```js
39
+ "kashi/use-logical-properties": [true, { direction: "rtl", locale: "fa", ignoreSelectors: ["^\\.legacy"] }]
40
+ ```
41
+
42
+ - `direction`: جهت اصلی پروژه، `"rtl"` (پیش‌فرض) یا `"ltr"`
43
+ - `locale`: زبان پیام‌ها، `"fa"`، `"en"` یا `"both"` (پیش‌فرض)
44
+ - `ignoreSelectors`: regex selectorهایی که بررسی نشوند
45
+
46
+ ---
47
+
48
+ # English
49
+
50
+ Right-to-left and Persian text rules for Stylelint 16–18, with autofix that keeps the current rendering in the project's main direction. Works in any project. Messages are Persian, English or both (`locale` option). [Docs](https://kashi.sepantapouya.com/docs/lint/)
51
+
52
+ MIT
@@ -0,0 +1,28 @@
1
+ export declare const rules: {
2
+ readonly "kashi/use-logical-properties": true;
3
+ readonly "kashi/use-logical-values": true;
4
+ readonly "kashi/no-physical-transform": readonly [true, {
5
+ readonly severity: "warning";
6
+ }];
7
+ readonly "kashi/no-root-direction": true;
8
+ readonly "kashi/tailwind-logical": true;
9
+ readonly "kashi/persian-text": readonly [true, {
10
+ readonly severity: "warning";
11
+ }];
12
+ };
13
+ declare const _default: {
14
+ plugins: import("stylelint").Plugin[];
15
+ rules: {
16
+ readonly "kashi/use-logical-properties": true;
17
+ readonly "kashi/use-logical-values": true;
18
+ readonly "kashi/no-physical-transform": readonly [true, {
19
+ readonly severity: "warning";
20
+ }];
21
+ readonly "kashi/no-root-direction": true;
22
+ readonly "kashi/tailwind-logical": true;
23
+ readonly "kashi/persian-text": readonly [true, {
24
+ readonly severity: "warning";
25
+ }];
26
+ };
27
+ };
28
+ export default _default;
package/dist/config.js ADDED
@@ -0,0 +1,11 @@
1
+ // پیکربندی پیشنهادی: extends: ["@kashi-ui/stylelint-plugin/config"]
2
+ import plugins from "./index.js";
3
+ export const rules = {
4
+ "kashi/use-logical-properties": true,
5
+ "kashi/use-logical-values": true,
6
+ "kashi/no-physical-transform": [true, { severity: "warning" }],
7
+ "kashi/no-root-direction": true,
8
+ "kashi/tailwind-logical": true,
9
+ "kashi/persian-text": [true, { severity: "warning" }],
10
+ };
11
+ export default { plugins, rules };
@@ -0,0 +1,8 @@
1
+ export declare const KASHI_DATA: {
2
+ version: string;
3
+ names: string[];
4
+ colors: Record<string, string[]>;
5
+ space: Record<string, string>;
6
+ radius: Record<string, string>;
7
+ fontSize: Record<string, string>;
8
+ };