pasika 0.3.6 → 0.3.8
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/README.md +61 -61
- package/dist/eslint/pasika/index.d.ts +3 -0
- package/dist/eslint/pasika/index.js +223 -113
- package/package.json +6 -15
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +0 -5380
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Documentation, the lint rules derived from it, and the CLI that applies and diag
|
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
10
|
docs/
|
|
11
|
-
|
|
11
|
+
repository-policy.md # agent-conduct requirements (Policy)
|
|
12
12
|
repository-policy.md # repo-wide code and documentation requirements (Policy)
|
|
13
13
|
code-organization-guide/ # placement, extraction, module conventions
|
|
14
14
|
documentation-guide/ # how documents themselves are written
|
|
@@ -38,7 +38,7 @@ Requirements are identified by a hash of their canonical text, not by a hand-wri
|
|
|
38
38
|
"text": "A .tsx file that defines a component MUST contain exactly one component.",
|
|
39
39
|
"hash": "b19fe3bd34",
|
|
40
40
|
"ref": "pasika/no-mixed-concerns",
|
|
41
|
-
"note": "counts exported components; a second component that is not exported is not detected"
|
|
41
|
+
"note": "counts exported components; a second component that is not exported is not detected",
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -101,74 +101,74 @@ export default [pasikaConfig];
|
|
|
101
101
|
|
|
102
102
|
### TS/TSX rules
|
|
103
103
|
|
|
104
|
-
| Rule
|
|
105
|
-
|
|
|
106
|
-
| `pasika/filename-case`
|
|
107
|
-
| `pasika/import-boundaries`
|
|
108
|
-
| `pasika/no-mixed-concerns`
|
|
109
|
-
| `pasika/no-arbitrary-tailwind`
|
|
110
|
-
| `pasika/enforce-cn-merge`
|
|
111
|
-
| `pasika/enforce-cva-variant-props` | `VariantProps<typeof …>` instead of hand-written unions
|
|
112
|
-
| `pasika/cva-appearance-props`
|
|
113
|
-
| `pasika/cva-boolean-variants`
|
|
114
|
-
| `pasika/enforce-barrel-exports`
|
|
115
|
-
| `pasika/component-placement` †
|
|
116
|
-
| `pasika/support-file-placement` †
|
|
117
|
-
| `pasika/application-structure`
|
|
118
|
-
| `pasika/named-exports`
|
|
119
|
-
| `pasika/data-testid-case`
|
|
120
|
-
| `pasika/support-folder-shape`
|
|
121
|
-
| `pasika/import-through-index`
|
|
122
|
-
| `pasika/util-file-name`
|
|
123
|
-
| `pasika/no-util-barrel`
|
|
124
|
-
| `pasika/jsx-hygiene`
|
|
125
|
-
| `pasika/interactive-component`
|
|
126
|
-
| `pasika/ui-state`
|
|
127
|
-
| `pasika/cross-feature-import`
|
|
128
|
-
| `pasika/pure-function-extract`
|
|
129
|
-
| `pasika/hook-complexity`
|
|
130
|
-
| `pasika/locale-dotted-path`
|
|
131
|
-
| `pasika/locales-location`
|
|
132
|
-
| `pasika/hook-extraction` †
|
|
133
|
-
| `pasika/value-extraction` †
|
|
134
|
-
| `pasika/config-extraction` †
|
|
135
|
-
| `pasika/component-nesting` †
|
|
136
|
-
| `pasika/stay-flat` †
|
|
137
|
-
| `pasika/type-extraction` †
|
|
138
|
-
| `pasika/locale-placement` †
|
|
139
|
-
| `pasika/locale-key-shape`
|
|
140
|
-
| `pasika/shared-style-dedup` †
|
|
141
|
-
| `pasika/repeated-structure`
|
|
142
|
-
| `pasika/sole-state-owner`
|
|
143
|
-
| `pasika/no-eslint-disable`
|
|
144
|
-
| `pasika/zod-schema-validation`
|
|
145
|
-
| `pasika/source-under-src`
|
|
104
|
+
| Rule | Enforces |
|
|
105
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
106
|
+
| `pasika/filename-case` | kebab-case for files that define no component |
|
|
107
|
+
| `pasika/import-boundaries` | The shorter of the relative path and the `@/*` alias, and the layer boundaries |
|
|
108
|
+
| `pasika/no-mixed-concerns` | One exported React component per `.tsx` file |
|
|
109
|
+
| `pasika/no-arbitrary-tailwind` | No arbitrary `-[value]` classes, including inside `cn()` conditionals |
|
|
110
|
+
| `pasika/enforce-cn-merge` | `cn()` instead of `+` or template literals; at most five classes per group |
|
|
111
|
+
| `pasika/enforce-cva-variant-props` | `VariantProps<typeof …>` instead of hand-written unions |
|
|
112
|
+
| `pasika/cva-appearance-props` | Visual option props (`size`, `variant`, …) declared through CVA appearance props |
|
|
113
|
+
| `pasika/cva-boolean-variants` | Boolean appearance props placed on the CVA variant, not as standalone props |
|
|
114
|
+
| `pasika/enforce-barrel-exports` | A nested `index.ts` re-exports only its component |
|
|
115
|
+
| `pasika/component-placement` † | The folder a component's consumers imply |
|
|
116
|
+
| `pasika/support-file-placement` † | The folder a hook, type, schema, constant, or utility belongs in |
|
|
117
|
+
| `pasika/application-structure` | The path-based parts of the application structure and configuration rules |
|
|
118
|
+
| `pasika/named-exports` | Named exports for application files (framework routing files may default-export) |
|
|
119
|
+
| `pasika/data-testid-case` | `data-testid` casing where a rendered result carries one |
|
|
120
|
+
| `pasika/support-folder-shape` | A `constants/`, `types/`, or `schemas/` folder defines exports directly in `index.ts` or in named-re-exported files |
|
|
121
|
+
| `pasika/import-through-index` | An extracted constant, type, or schema is imported through its folder's `index.ts` |
|
|
122
|
+
| `pasika/util-file-name` | A single-function utility file is named in the function's kebab-case form |
|
|
123
|
+
| `pasika/no-util-barrel` | A utility is imported directly, without a barrel |
|
|
124
|
+
| `pasika/jsx-hygiene` | Calculations and complex conditions stay out of JSX children and attributes |
|
|
125
|
+
| `pasika/interactive-component` | Interactive elements are component boundaries when mixed with other content |
|
|
126
|
+
| `pasika/ui-state` | Native or ARIA state expression and Tailwind state variants |
|
|
127
|
+
| `pasika/cross-feature-import` | A component importing from two or more feature folders lives in a shared location |
|
|
128
|
+
| `pasika/pure-function-extract` | Pure functions extracted to `utils/`, even with one consumer |
|
|
129
|
+
| `pasika/hook-complexity` | Hook complexity limits (imperative categories per hook) |
|
|
130
|
+
| `pasika/locale-dotted-path` | A namespaced locale is read through its full dotted path |
|
|
131
|
+
| `pasika/locales-location` | Locales live in the named locales object |
|
|
132
|
+
| `pasika/hook-extraction` † | A hook with two or more consumers is extracted to its own file |
|
|
133
|
+
| `pasika/value-extraction` † | A value with cross-folder consumers is extracted |
|
|
134
|
+
| `pasika/config-extraction` † | A type, schema, or utility used outside its config module is moved |
|
|
135
|
+
| `pasika/component-nesting` † | A component is not nested solely because it has support files |
|
|
136
|
+
| `pasika/stay-flat` † | A component stays flat until it has exclusive children |
|
|
137
|
+
| `pasika/type-extraction` † | A type or schema with cross-folder consumers is extracted |
|
|
138
|
+
| `pasika/locale-placement` † | Shared locales at the top level, single-feature locales namespaced |
|
|
139
|
+
| `pasika/locale-key-shape` | camelCase locale keys; keys over 30 characters end in a WAI-ARIA element role |
|
|
140
|
+
| `pasika/shared-style-dedup` † | A className combo used by two or more components becomes a named utility |
|
|
141
|
+
| `pasika/repeated-structure` | A block of elements repeated two or more times is extracted as a named component |
|
|
142
|
+
| `pasika/sole-state-owner` | A contiguous JSX part that is the sole consumer of a useState hook is extracted into a named component |
|
|
143
|
+
| `pasika/no-eslint-disable` | No `eslint-disable` directives |
|
|
144
|
+
| `pasika/zod-schema-validation` | Runtime validation through Zod schemas, not hand-written type guards |
|
|
145
|
+
| `pasika/source-under-src` | Application source lives under `src/`, not in root-level folders |
|
|
146
146
|
|
|
147
147
|
### CSS rules
|
|
148
148
|
|
|
149
149
|
Applied to `src/**/globals.css` (and other stylesheets) through `@eslint/css` with tolerant Tailwind v4 parsing.
|
|
150
150
|
|
|
151
|
-
| Rule
|
|
152
|
-
|
|
|
153
|
-
| `pasika/theme-reset`
|
|
154
|
-
| `pasika/root-variables`
|
|
155
|
-
| `pasika/apply-usage`
|
|
156
|
-
| `pasika/base-layer-pair`
|
|
157
|
-
| `pasika/stylesheet-ordering`
|
|
158
|
-
| `pasika/css-variable-naming`
|
|
159
|
-
| `pasika/custom-utility-apply`
|
|
160
|
-
| `pasika/surface-utility`
|
|
161
|
-
| `pasika/theme-variable-namespace` | Utility class groups share a namespace prefix
|
|
162
|
-
| `pasika/global-css-location`
|
|
151
|
+
| Rule | Enforces |
|
|
152
|
+
| --------------------------------- | ----------------------------------------------------------------------------- |
|
|
153
|
+
| `pasika/theme-reset` | A `--*: initial` theme reset is present |
|
|
154
|
+
| `pasika/root-variables` | `:root` defines the CSS custom properties |
|
|
155
|
+
| `pasika/apply-usage` | `@layer base` uses `@apply` for declarations |
|
|
156
|
+
| `pasika/base-layer-pair` | The base layer applies `base-canvas` and `base-ink` |
|
|
157
|
+
| `pasika/stylesheet-ordering` | Imports → `@custom-variant` → `:root` → `@theme` → `@utility` → `@layer base` |
|
|
158
|
+
| `pasika/css-variable-naming` | Background vars named `--<role>-canvas`, text vars `--<role>-ink` |
|
|
159
|
+
| `pasika/custom-utility-apply` | `@utility` blocks use `@apply` |
|
|
160
|
+
| `pasika/surface-utility` | Repeated canvas+ink combos become a named surface utility |
|
|
161
|
+
| `pasika/theme-variable-namespace` | Utility class groups share a namespace prefix |
|
|
162
|
+
| `pasika/global-css-location` | Global CSS lives in the correct entry point |
|
|
163
163
|
|
|
164
164
|
### JSON rules
|
|
165
165
|
|
|
166
166
|
Applied to `package.json` through `@eslint/json`.
|
|
167
167
|
|
|
168
|
-
| Rule
|
|
169
|
-
|
|
|
170
|
-
| `pasika/no-cache-flag`
|
|
171
|
-
| `pasika/no-vulyk-dependency` | `vulyk` is not in `dependencies`
|
|
168
|
+
| Rule | Enforces |
|
|
169
|
+
| ---------------------------- | --------------------------------- |
|
|
170
|
+
| `pasika/no-cache-flag` | Lint scripts don't pass `--cache` |
|
|
171
|
+
| `pasika/no-vulyk-dependency` | `vulyk` is not in `dependencies` |
|
|
172
172
|
|
|
173
173
|
### Documentation rules
|
|
174
174
|
|
|
@@ -180,7 +180,7 @@ Run `pasika coverage --json` for the exact requirement each rule covers.
|
|
|
180
180
|
|
|
181
181
|
Where a component, hook, value, type, or style belongs depends on which files use it, so the rules marked † index the whole `src/` tree instead of looking at one file. Two consequences:
|
|
182
182
|
|
|
183
|
-
- **Do not pass `--cache`.** Move a file and the finding belongs to a
|
|
183
|
+
- **Do not pass `--cache`.** Move a file and the finding belongs to a _different_ file, whose cache entry is unchanged — so ESLint would replay a stale verdict. `repository-policy.md` requires lint commands to run without it.
|
|
184
184
|
- The index is read from disk rather than from ESLint's file list, so a partial run such as `lint-staged` still judges against the true graph.
|
|
185
185
|
|
|
186
186
|
All are inert in a repository with no `src/` tree.
|
|
@@ -112,10 +112,12 @@ declare const cssRules: {
|
|
|
112
112
|
"surface-utility": _eslint_css.CSSRuleDefinition;
|
|
113
113
|
"theme-variable-namespace": _eslint_css.CSSRuleDefinition;
|
|
114
114
|
"global-css-location": _eslint_css.CSSRuleDefinition;
|
|
115
|
+
"global-stylesheet": _eslint_css.CSSRuleDefinition;
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
declare const jsonRules: {
|
|
118
119
|
"no-vulyk-dependency": _eslint_json.JSONRuleDefinition;
|
|
120
|
+
"zirka-installed": _eslint_json.JSONRuleDefinition;
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
declare const pasikaRules: {
|
|
@@ -169,6 +171,7 @@ declare const pasikaRules: {
|
|
|
169
171
|
"repeated-structure": eslint.Rule.RuleModule;
|
|
170
172
|
"zod-schema-validation": eslint.Rule.RuleModule;
|
|
171
173
|
"source-under-src": eslint.Rule.RuleModule;
|
|
174
|
+
"config-baseline": eslint.Rule.RuleModule;
|
|
172
175
|
};
|
|
173
176
|
|
|
174
177
|
/** Rule ids as they appear in configuration and in lint output. */
|