forked from frappe/lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind-rtl.yml
More file actions
46 lines (44 loc) · 1.8 KB
/
tailwind-rtl.yml
File metadata and controls
46 lines (44 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Local run: semgrep scan --config .github/semgrep/tailwind-rtl.yml
rules:
- id: tailwind-physical-class
message: |
RTL: replace physical Tailwind class with logical equivalent.
languages: [generic]
severity: WARNING
paths: { include: ["*.vue"] }
patterns:
- pattern-either:
- pattern-regex: |
(?x)
(?:^|[\s"'`(\[{,])
!?
(?:[^\s"':]+:)*
-?
(?:
(?:scroll-)?[mp][lr]-(?:auto|px|full|\d+(?:[./]\d+)?|\[[^\]]+\])
| (?:left|right)-(?:auto|px|full|\d+(?:[./]\d+)?|\[[^\]]+\])
| (?:text|float|clear)-(?:left|right)
| (?:border|rounded)-[lr](?:-[A-Za-z0-9\[\]./#%_-]+)?
| rounded-(?:tl|tr|bl|br)(?:-[A-Za-z0-9\[\]./#%_-]+)?
)
!?
(?=$|[\s'"`})\],>;])
- pattern-not-regex: '\b(?:rtl|ltr):'
- id: tailwind-space-x-needs-reverse-or-gap
message: |
RTL: `space-x-*` does not flip in RTL. add `rtl:space-x-reverse` or `gap-x-* ms-*`
languages: [generic]
severity: WARNING
paths: { include: ["*.vue"] }
patterns:
- pattern-regex: 'class\s*[:=]\s*"[^"]*\bspace-x-\S+[^"]*"'
- pattern-not-regex: '\brtl:space-x-reverse\b'
- id: tailwind-divide-x-needs-reverse
message: |
RTL: `divide-x-*` does not flip in RTL, sdd `rtl:divide-x-reverse`.
languages: [generic]
severity: WARNING
paths: { include: ["*.vue"] }
patterns:
- pattern-regex: 'class\s*[:=]\s*"[^"]*\bdivide-x(?:-\S+)?[^"]*"'
- pattern-not-regex: '\brtl:divide-x-reverse\b'