pasika 0.1.6 → 0.2.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.
Files changed (68) hide show
  1. package/README.md +40 -55
  2. package/dist/eslint/pasika/index.d.ts +18 -0
  3. package/dist/eslint/pasika/index.js +18 -3
  4. package/dist/eslint/pasika/rules/enforce-barrel-exports.d.ts +9 -0
  5. package/dist/eslint/pasika/rules/enforce-barrel-exports.js +78 -0
  6. package/dist/eslint/pasika/rules/enforce-cn-merge.d.ts +9 -0
  7. package/dist/eslint/pasika/rules/enforce-cn-merge.js +84 -0
  8. package/dist/eslint/pasika/rules/enforce-cva-variant-props.d.ts +9 -0
  9. package/dist/eslint/pasika/rules/enforce-cva-variant-props.js +76 -0
  10. package/dist/eslint/pasika/rules/filename-case.js +10 -0
  11. package/dist/eslint/pasika/rules/import-boundaries.d.ts +2 -0
  12. package/dist/eslint/pasika/rules/{organization-imports.js → import-boundaries.js} +11 -1
  13. package/dist/eslint/pasika/rules/no-arbitrary-tailwind.d.ts +9 -0
  14. package/dist/eslint/pasika/rules/no-arbitrary-tailwind.js +107 -0
  15. package/dist/eslint/pasika/rules/no-mixed-concerns.d.ts +9 -0
  16. package/dist/eslint/pasika/rules/no-mixed-concerns.js +84 -0
  17. package/package.json +5 -16
  18. package/claude/hooks/.vulyk +0 -3
  19. package/claude/hooks/AGENTS.md +0 -3
  20. package/claude/hooks/CLAUDE.md +0 -1
  21. package/claude/hooks/claude-hooks.md +0 -30
  22. package/claude/hooks/notification.sh +0 -38
  23. package/claude/hooks/protect-files.sh +0 -21
  24. package/claude/hooks/status-line/index.js +0 -57
  25. package/claude/scripts/render-settings.ts +0 -223
  26. package/claude/settings.base.json +0 -38
  27. package/dist/claude/scripts/render-settings.js +0 -145
  28. package/dist/eslint/pasika/rules/organization-imports.d.ts +0 -2
  29. package/dist/eslint.config.js +0 -7
  30. package/dist/scripts/pasika.js +0 -59
  31. package/docs/agent-conventions.md +0 -27
  32. package/docs/claude/hooks.md +0 -30
  33. package/docs/code-organization-guide/code-organization-guide.md +0 -69
  34. package/docs/code-organization-guide/references/application-architecture-reference.md +0 -149
  35. package/docs/code-organization-guide/rules/component-placement-rule.md +0 -119
  36. package/docs/code-organization-guide/rules/configuration-rule.md +0 -42
  37. package/docs/code-organization-guide/rules/constants-rule.md +0 -74
  38. package/docs/code-organization-guide/rules/exports-and-imports-rule.md +0 -84
  39. package/docs/code-organization-guide/rules/folder-nesting-rule.md +0 -82
  40. package/docs/code-organization-guide/rules/hook-extraction-rule.md +0 -141
  41. package/docs/code-organization-guide/rules/interactive-component-rule.md +0 -97
  42. package/docs/code-organization-guide/rules/jsx-hygiene-rule.md +0 -67
  43. package/docs/code-organization-guide/rules/locales-rule.md +0 -53
  44. package/docs/code-organization-guide/rules/nameable-visual-concept-rule.md +0 -66
  45. package/docs/code-organization-guide/rules/no-mixed-concerns-rule.md +0 -63
  46. package/docs/code-organization-guide/rules/repeated-structure-rule.md +0 -93
  47. package/docs/code-organization-guide/rules/smart-vs-dumb-component-rule.md +0 -112
  48. package/docs/code-organization-guide/rules/sole-state-owner-rule.md +0 -101
  49. package/docs/code-organization-guide/rules/types-and-schemas-rule.md +0 -139
  50. package/docs/code-organization-guide/rules/utilities-rule.md +0 -86
  51. package/docs/documentation-guide/_templates/grouped-reference.md +0 -11
  52. package/docs/documentation-guide/_templates/guide.md +0 -19
  53. package/docs/documentation-guide/_templates/rule.md +0 -21
  54. package/docs/documentation-guide/_templates/single-lookup-reference.md +0 -5
  55. package/docs/documentation-guide/documentation-guide.md +0 -13
  56. package/docs/documentation-guide/references/documentation-types-reference.md +0 -9
  57. package/docs/documentation-guide/rules/guide-creation-rule.md +0 -113
  58. package/docs/documentation-guide/rules/reference-creation-rule.md +0 -132
  59. package/docs/documentation-guide/rules/rule-creation-rule.md +0 -81
  60. package/docs/documentation-guide/rules/template-usage-rule.md +0 -49
  61. package/docs/shadcn-theme.md +0 -121
  62. package/docs/styling-guide/rules/arbitrary-value-rule.md +0 -31
  63. package/docs/styling-guide/rules/class-composition-rule.md +0 -52
  64. package/docs/styling-guide/rules/component-ui-state-rule.md +0 -53
  65. package/docs/styling-guide/rules/component-variant-rule.md +0 -125
  66. package/docs/styling-guide/rules/global-stylesheet-rule.md +0 -67
  67. package/docs/styling-guide/rules/theme-and-utility-definition-rule.md +0 -86
  68. package/docs/styling-guide/styling-guide.md +0 -14
@@ -1,125 +0,0 @@
1
- # Component Variant Rule
2
-
3
- `cva` is Class Variance Authority, a helper for defining a component's visual options and deriving their TypeScript API. `cn` handles a standalone boolean choice without creating a variant matrix.
4
-
5
- - A component that lets callers choose visual options MUST define them with `cva`.
6
- - A component's variant prop types MUST be derived from its `cva` definition with `VariantProps` rather than manually duplicated unions.
7
- - A boolean prop that changes appearance MUST use conditional `cn()` when it only adds or removes one standalone class treatment.
8
- - A boolean prop that changes appearance MUST use a CVA variant when both boolean values have explicit treatments or when the boolean participates in a compound variant.
9
-
10
- ## Incorrect — Variant Union Duplicated by Hand
11
-
12
- ```tsx
13
- const buttonVariants = cva("inline-flex items-center", {
14
- variants: {
15
- size: {
16
- sm: "h-8 px-3",
17
- lg: "h-11 px-5",
18
- },
19
- },
20
- });
21
-
22
- type ButtonProps = React.ComponentProps<"button"> & {
23
- size?: "sm" | "lg";
24
- };
25
- ```
26
-
27
- Why: the accepted `size` values now live in both CVA and a handwritten prop union, so either side can change without the other.
28
-
29
- ## Correct — Props Derived from CVA
30
-
31
- ```tsx
32
- const buttonVariants = cva("inline-flex items-center", {
33
- variants: {
34
- size: {
35
- sm: "h-8 px-3",
36
- lg: "h-11 px-5",
37
- },
38
- tone: {
39
- primary: "primary-surface",
40
- danger: "danger-surface",
41
- },
42
- },
43
- defaultVariants: {
44
- size: "sm",
45
- tone: "primary",
46
- },
47
- });
48
-
49
- type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>;
50
-
51
- export function Button({ size, tone, className, ...props }: ButtonProps): React.JSX.Element {
52
- return <button className={cn(buttonVariants({ size, tone }), className)} {...props} />;
53
- }
54
- ```
55
-
56
- Why: the CVA definition owns the accepted values, defaults, and classes, while `VariantProps` derives the public TypeScript API from the same source.
57
-
58
- ## Incorrect — Standalone Boolean Variant Added to CVA
59
-
60
- ```tsx
61
- const buttonVariants = cva("inline-flex", {
62
- variants: {
63
- elevated: {
64
- true: "shadow-md",
65
- false: "",
66
- },
67
- },
68
- });
69
- ```
70
-
71
- Why: one boolean variant merely adds a standalone treatment and has no compound relationship, so CVA adds configuration without a styling matrix.
72
-
73
- ## Correct — Standalone Boolean Variant Uses `cn`
74
-
75
- ```tsx
76
- <button className={cn(buttonVariants({ size, tone }), elevated && "shadow-md", className)} />
77
- ```
78
-
79
- Why: the named appearance choices stay in CVA while the independent boolean variant remains a direct conditional class.
80
-
81
- ## Incorrect — Compound Boolean Variant Styling Split Across Conditions
82
-
83
- ```tsx
84
- <button
85
- className={cn(
86
- buttonVariants({ size }),
87
- square && "justify-center",
88
- square && size === "sm" && "w-8 px-0",
89
- square && size === "lg" && "w-11 px-0",
90
- )}
91
- />
92
- ```
93
-
94
- Why: the boolean variant changes treatment according to another variant, but the styling matrix is spread across conditional expressions outside CVA.
95
-
96
- ## Correct — Boolean Variant with Compound Styling Uses CVA
97
-
98
- ```tsx
99
- const buttonVariants = cva("inline-flex", {
100
- variants: {
101
- size: {
102
- sm: "h-8 px-3",
103
- lg: "h-11 px-5",
104
- },
105
- square: {
106
- true: "justify-center",
107
- false: "justify-start",
108
- },
109
- },
110
- compoundVariants: [
111
- {
112
- size: "sm",
113
- square: true,
114
- className: "w-8 px-0",
115
- },
116
- {
117
- size: "lg",
118
- square: true,
119
- className: "w-11 px-0",
120
- },
121
- ],
122
- });
123
- ```
124
-
125
- Why: both boolean values have explicit treatment and the square appearance changes by size, so CVA owns the complete styling matrix.
@@ -1,67 +0,0 @@
1
- # Global Stylesheet Rule
2
-
3
- Use the global stylesheet to define Tailwind, the shared theme, and base styles. This rule keeps all of the project's global CSS in one entry point and ordered predictably.
4
-
5
- - A repository MUST have one global stylesheet entry point that registers Tailwind.
6
- - The project's global CSS MUST live in the global stylesheet entry point and MUST NOT be imported from another file.
7
- - The global stylesheet MUST reset Tailwind's default theme with `--*: initial`.
8
- - Every value used for the project's styling MUST be defined as a CSS variable in `:root`, even when no theme selector overrides it. A Tailwind theme variable MUST reference that CSS variable through `@theme inline`.
9
- - Style declarations added by the project inside global selectors MUST use `@apply`.
10
- - The global stylesheet MUST order imports, `@custom-variant` definitions, `:root` variables and the selectors that override them, `@theme` definitions, custom utilities, base styles, and keyframes in that order.
11
- - The global base layer MUST apply `base-canvas` and `base-ink` to the document body as the default page pair.
12
-
13
- ## Incorrect — Global Styles Split Across Unrelated Files
14
-
15
- ```css
16
- /* globals.css */
17
- @import "tailwindcss";
18
-
19
- @theme {
20
- --spacing: 0.25rem;
21
- }
22
-
23
- /* editor.css */
24
- @import "tailwindcss";
25
-
26
- @theme {
27
- --font-editor: Georgia, serif;
28
- }
29
- ```
30
-
31
- Why: Tailwind and theme definitions are split across competing global entry points, so neither file clearly owns the system.
32
-
33
- ## Correct — One Global Stylesheet Owns the System
34
-
35
- ```css
36
- @import "tailwindcss";
37
-
38
- :root {
39
- --spacing: 0.25rem;
40
- --base-canvas: #ffffff;
41
- --base-ink: #111827;
42
- }
43
-
44
- @theme {
45
- --*: initial;
46
- }
47
-
48
- @theme inline {
49
- --spacing: var(--spacing);
50
- }
51
-
52
- @utility bg-base-canvas {
53
- @apply bg-(--base-canvas);
54
- }
55
-
56
- @utility text-base-ink {
57
- @apply text-(--base-ink);
58
- }
59
-
60
- @layer base {
61
- body {
62
- @apply bg-base-canvas text-base-ink;
63
- }
64
- }
65
- ```
66
-
67
- Why: one entry point registers Tailwind, defines the shared system, and applies document defaults in a predictable order.
@@ -1,86 +0,0 @@
1
- # Theme and Utility Definition Rule
2
-
3
- This rule decides when styling stays with one component or becomes a shared utility, and how project values are exposed through Tailwind.
4
-
5
- - Styling used by only one component MUST stay in that component file as static Tailwind utility classes and MUST NOT be moved to the global stylesheet.
6
- - A style or group of styles that two or more components use together and should change together MUST become one named custom utility. The group MAY include utilities generated by theme variables, built-in utilities, other custom utilities, and interaction styles.
7
- - A value that needs at least two utility classes from the same [Tailwind theme-variable namespace](https://tailwindcss.com/docs/theme#theme-variable-namespaces) MUST use that namespace and have the same name in `:root`.
8
- - A CSS variable intended only for a background MUST be named `--<role>-canvas`, and one intended only for readable text MUST be named `--<role>-ink`. When a named custom utility exposes one of those values by itself, it MUST use `bg-<role>-canvas` or `text-<role>-ink`.
9
- - A repeated combination of canvas, ink, and related styles MUST become a `*-surface` custom Tailwind utility that owns the combination.
10
- - A custom utility MUST use `@apply` for every styling declaration added by the project. When no named built-in utility represents a property value, it MUST apply the Tailwind custom-property or arbitrary-property utility instead.
11
-
12
- ## Incorrect — Property-Specific Color Exposed Broadly
13
-
14
- ```css
15
- :root {
16
- --color-header-ink: #111827;
17
- }
18
-
19
- @theme inline {
20
- --color-header-ink: var(--color-header-ink);
21
- }
22
- ```
23
-
24
- ```tsx
25
- <h1 className="text-header-ink">Title</h1>
26
- ```
27
-
28
- Why: registering a text-only color in `--color-*` also creates unintended background, border, ring, and other color utilities.
29
-
30
- ## Correct — Property-Specific Utility
31
-
32
- ```css
33
- :root {
34
- --header-ink: #111827;
35
- }
36
-
37
- @utility text-header-ink {
38
- @apply text-(--header-ink);
39
- }
40
- ```
41
-
42
- ```tsx
43
- // SiteHeader.tsx
44
- <h1 className="text-header-ink">Title</h1>
45
-
46
- // PageHeader.tsx
47
- <h2 className="text-header-ink">Settings</h2>
48
- ```
49
-
50
- Why: both components use the same text-only color, so one named text utility owns it without creating background, border, or ring utilities.
51
-
52
- ## Incorrect — Property-Specific Colors Exposed Broadly
53
-
54
- ```css
55
- @theme {
56
- --color-primary-canvas: #d87943;
57
- --color-primary-ink: #ffffff;
58
- }
59
- ```
60
-
61
- ```tsx
62
- <button className="bg-primary-canvas text-primary-ink">Save</button>
63
- <button className="bg-primary-canvas text-primary-ink">Continue</button>
64
- ```
65
-
66
- Why: property-specific colors are exposed as broad Tailwind colors, and the repeated combination has no named owner.
67
-
68
- ## Correct — Color Roles Expose Their Intended API
69
-
70
- ```css
71
- :root {
72
- --primary-canvas: #d87943;
73
- --primary-ink: #ffffff;
74
- }
75
-
76
- @utility primary-surface {
77
- @apply bg-(--primary-canvas) text-(--primary-ink);
78
- }
79
- ```
80
-
81
- ```tsx
82
- <button className="primary-surface">Save</button>
83
- <button className="primary-surface">Continue</button>
84
- ```
85
-
86
- Why: canvas and ink CSS variables are used only by `primary-surface`, and the repeated combination has one named owner.
@@ -1,14 +0,0 @@
1
- # Styling Guide
2
-
3
- This guide keeps component styling predictable without making consumers learn a component's DOM or a project's CSS internals. It applies whenever UI styling is added or changed.
4
-
5
- ## How To Style a Component
6
-
7
- Use this workflow when implementing a component or changing its appearance.
8
-
9
- 1. Follow the [Global Stylesheet Rule](rules/global-stylesheet-rule.md) so one stylesheet entry point owns all of the project's global CSS.
10
- 2. Follow the [Theme and Utility Definition Rule](rules/theme-and-utility-definition-rule.md) so CSS variables, Tailwind namespaces, and custom utilities expose only the intended API.
11
- 3. Follow the [Arbitrary Value Rule](rules/arbitrary-value-rule.md) so values used for the project's styling use named utilities or tokens instead of literal arbitrary classes.
12
- 4. Follow the [Class Composition Rule](rules/class-composition-rule.md) so conditional and consumer-supplied classes merge predictably.
13
- 5. Follow the [Component Variant Rule](rules/component-variant-rule.md) so supported internal appearances are a typed component API.
14
- 6. Follow the [Component UI State Rule](rules/component-ui-state-rule.md) so interaction, disabled, selected, loading, and error UI states stay coherent.