zirka 0.0.75 → 0.0.76
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 +64 -75
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
> зірка — _star_ in Ukrainian
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
One `styleguide()` call returns your ESLint, Prettier, and TypeScript config. Every block loads lazily, so only the plugins you enable are ever imported.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
## Install
|
|
9
|
+
## 📦 Install
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
npm i -D zirka eslint prettier typescript
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Node ≥ 22. Peer versions: `eslint` ^10.9.1 · `prettier` ^3.5.3 · `typescript` >=5.8.3 <6.1.0.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## ⚡ Quick start
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
+
// eslint.config.ts
|
|
20
21
|
import { RuleSeverity, styleguide } from "zirka";
|
|
21
22
|
|
|
22
23
|
const { eslintConfig } = styleguide({
|
|
@@ -28,9 +29,30 @@ const { eslintConfig } = styleguide({
|
|
|
28
29
|
export default eslintConfig;
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
```js
|
|
33
|
+
// prettier.config.js
|
|
34
|
+
import { styleguide } from "zirka";
|
|
35
|
+
|
|
36
|
+
const { prettierConfig } = styleguide({ prettier: true });
|
|
37
|
+
|
|
38
|
+
export default prettierConfig;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
// tsconfig.json
|
|
43
|
+
{
|
|
44
|
+
"extends": "zirka/typescript",
|
|
45
|
+
"compilerOptions": { "module": "NodeNext", "moduleResolution": "NodeNext", "noEmit": true },
|
|
46
|
+
"include": ["**/*.ts"],
|
|
47
|
+
"exclude": ["node_modules", "dist"]
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`jiti` is bundled, so a TypeScript config file works with no setup.
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
## ⚙️ ESLint
|
|
54
|
+
|
|
55
|
+
Each block brings its own globals and rule sets, and is never imported unless you enable it:
|
|
34
56
|
|
|
35
57
|
| Block | Globals | Rules |
|
|
36
58
|
| ----------------- | -------------------------- | -------------------------------------------------- |
|
|
@@ -40,32 +62,21 @@ Each config block is loaded lazily — if you don't enable `react`, none of its
|
|
|
40
62
|
| `react` | — | `@eslint-react`, `react-hooks`, `jsx-a11y` |
|
|
41
63
|
| `next` | — | `@next/eslint-plugin-next` |
|
|
42
64
|
| `playwright` | — | `eslint-plugin-playwright` |
|
|
43
|
-
| `pasikaApp` | — | Pasika rules for a plain TypeScript repository
|
|
44
|
-
| `pasikaNextjsApp` | — | Pasika rules for a Next.js application
|
|
45
|
-
|
|
46
|
-
Base rules (always included with any block): `@eslint/js` recommended, `@eslint-community/eslint-plugin-eslint-comments`, `eslint-plugin-unicorn`, the hand-written best-practice, ES6, possible-errors, stylistic, and variables rule sets, and `eslint-plugin-prettier` (with `eslint-config-prettier` disabling any ESLint stylistic rule that would fight it) — so `eslint --fix` also reformats JS/TS files against whatever `prettier.config` the repository resolves.
|
|
65
|
+
| `pasikaApp` | — | Pasika's rules for a plain TypeScript repository |
|
|
66
|
+
| `pasikaNextjsApp` | — | Pasika's rules for a Next.js application |
|
|
47
67
|
|
|
48
|
-
|
|
68
|
+
The base rules come with every block: `@eslint/js` recommended, `eslint-plugin-eslint-comments`, `eslint-plugin-unicorn`, the hand-written best-practice / ES6 / possible-errors / stylistic / variables sets, and `eslint-plugin-prettier` with `eslint-config-prettier` disabling any stylistic rule that would fight it — so `eslint --fix` also reformats JS/TS against whatever `prettier.config` the repository resolves.
|
|
49
69
|
|
|
50
|
-
Enabling a pasika preset
|
|
70
|
+
Enabling a pasika preset adds four language-scoped rule sets:
|
|
51
71
|
|
|
52
72
|
| Files | Rules |
|
|
53
73
|
| ------------------------------------------ | ------------------------- |
|
|
54
74
|
| `src/**/*.{js,jsx,ts,tsx,mjs,mts,cjs,cts}` | `pasika/*` TS/TSX rules |
|
|
55
|
-
| `src
|
|
75
|
+
| `src/**/*.css` | `pasika/*` CSS rules |
|
|
56
76
|
| `**/*.md` (not `_templates/`) | `pasika/*` Markdown rules |
|
|
57
77
|
| `package.json` | `pasika/*` JSON rules |
|
|
58
78
|
|
|
59
|
-
`pasikaApp` is the baseline
|
|
60
|
-
|
|
61
|
-
### `RuleSeverity`
|
|
62
|
-
|
|
63
|
-
| Value | Behaviour |
|
|
64
|
-
| ----------- | ------------------------------------------------ |
|
|
65
|
-
| `"error"` | All rules set to `error` |
|
|
66
|
-
| `"warn"` | All rules set to `warn` |
|
|
67
|
-
| `"default"` | Rules use their recommended severity as-is |
|
|
68
|
-
| `"off"` | Config block skipped entirely — nothing imported |
|
|
79
|
+
`pasikaApp` is the baseline — manifest, zirka contract, docs — and carries no `src/**` block; `pasikaNextjsApp` is everything in it plus the Next.js-stack manifest requirement, the source rules, and the Tailwind stylesheet rules. The JS/TS base blocks are scoped to JS/TS files, so a CSS, Markdown, or JSON file is always linted by its own rules.
|
|
69
80
|
|
|
70
81
|
### Options
|
|
71
82
|
|
|
@@ -78,71 +89,49 @@ Enabling a pasika preset wires four language-scoped rule sets (see the pasika RE
|
|
|
78
89
|
| `next` | `RuleSeverity` | Next.js rules |
|
|
79
90
|
| `pasikaApp` | `RuleSeverity` | Pasika rules for a plain TypeScript repository |
|
|
80
91
|
| `pasikaNextjsApp` | `RuleSeverity` | Pasika rules for a Next.js application |
|
|
81
|
-
| `playwright` | `RuleSeverity \| { files: string[]; severity: RuleSeverity }` | Playwright
|
|
92
|
+
| `playwright` | `RuleSeverity \| { files: string[]; severity: RuleSeverity }` | Playwright rules and optional file scope |
|
|
82
93
|
| `ignores` | `string[]` | Glob patterns to ignore |
|
|
83
|
-
| `additionalConfigs` | `Linter.Config[]` | Extra flat config entries appended last
|
|
84
|
-
| `prettier` | `true \| { tailwind?: boolean }` | Enable Prettier config
|
|
85
|
-
|
|
86
|
-
---
|
|
94
|
+
| `additionalConfigs` | `Linter.Config[]` | Extra flat config entries, appended last |
|
|
95
|
+
| `prettier` | `true \| { tailwind?: boolean }` | Enable the Prettier config |
|
|
87
96
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```js
|
|
91
|
-
import { styleguide } from "zirka";
|
|
92
|
-
|
|
93
|
-
const { prettierConfig } = styleguide({
|
|
94
|
-
prettier: true,
|
|
95
|
-
});
|
|
97
|
+
### `RuleSeverity`
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
| Value | Behaviour |
|
|
100
|
+
| ----------- | ------------------------------------------------ |
|
|
101
|
+
| `"error"` | All rules set to `error` |
|
|
102
|
+
| `"warn"` | All rules set to `warn` |
|
|
103
|
+
| `"default"` | Rules keep their recommended severity |
|
|
104
|
+
| `"off"` | Config block skipped entirely — nothing imported |
|
|
99
105
|
|
|
100
|
-
|
|
106
|
+
## 💅 Prettier
|
|
101
107
|
|
|
102
108
|
```js
|
|
103
|
-
const { prettierConfig } = styleguide({
|
|
104
|
-
prettier: { tailwind: true },
|
|
105
|
-
});
|
|
109
|
+
const { prettierConfig } = styleguide({ prettier: { tailwind: true } });
|
|
106
110
|
```
|
|
107
111
|
|
|
108
|
-
|
|
112
|
+
`prettier: true` is the plain config; the `tailwind` option adds `prettier-plugin-tailwindcss`. `prettier-plugin-packagejson` is included either way.
|
|
109
113
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## TypeScript — `tsconfig.json`
|
|
114
|
+
## 🧩 TypeScript
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
`zirka/typescript` sets strictness only — no environment-specific settings — so you extend it and add your own `module`, `lib`, `target`. The base flags are in [`typescript/base.json`](https://github.com/Bredansky/zirka/blob/main/typescript/base.json).
|
|
115
117
|
|
|
116
|
-
|
|
117
|
-
{
|
|
118
|
-
"extends": "zirka/typescript",
|
|
119
|
-
"compilerOptions": {
|
|
120
|
-
"module": "NodeNext",
|
|
121
|
-
"moduleResolution": "NodeNext",
|
|
122
|
-
"noEmit": true
|
|
123
|
-
},
|
|
124
|
-
"include": ["**/*.ts"],
|
|
125
|
-
"exclude": ["node_modules", "dist"]
|
|
126
|
-
}
|
|
127
|
-
```
|
|
118
|
+
## 📚 Documentation
|
|
128
119
|
|
|
129
|
-
|
|
120
|
+
| What | Where |
|
|
121
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
122
|
+
| The `styleguide()` factory | [`styleguide.ts`](https://github.com/Bredansky/zirka/blob/main/styleguide.ts) |
|
|
123
|
+
| One file per ESLint block | [`eslint/`](https://github.com/Bredansky/zirka/tree/main/eslint) |
|
|
124
|
+
| The Prettier config | [`prettier-config/`](https://github.com/Bredansky/zirka/tree/main/prettier-config) |
|
|
125
|
+
| What `pasika/*` rules require | the [Pasika Adoption Guide](https://github.com/Bredansky/pasika/blob/main/docs/pasika-adoption-guide/pasika-adoption-guide.md) |
|
|
130
126
|
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
"strict": true,
|
|
134
|
-
"esModuleInterop": true,
|
|
135
|
-
"skipLibCheck": true,
|
|
136
|
-
"forceConsistentCasingInFileNames": true,
|
|
137
|
-
"noFallthroughCasesInSwitch": true,
|
|
138
|
-
"noUncheckedIndexedAccess": true,
|
|
139
|
-
"resolveJsonModule": true
|
|
140
|
-
}
|
|
141
|
-
```
|
|
127
|
+
## 🐝 Sibling packages
|
|
142
128
|
|
|
143
|
-
|
|
129
|
+
| Package | What it does |
|
|
130
|
+
| --------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
131
|
+
| [vulyk](https://github.com/Bredansky/vulyk) | Installs skills and tracked docs from pinned sources, and generates agent files |
|
|
132
|
+
| [pasika](https://github.com/Bredansky/pasika) | The documentation, the rules derived from it, and the helpers |
|
|
133
|
+
| **zirka** | Wires ESLint, Prettier, and TypeScript into one `styleguide()` config — this package |
|
|
144
134
|
|
|
145
|
-
##
|
|
135
|
+
## 📄 License
|
|
146
136
|
|
|
147
|
-
|
|
148
|
-
- `eslint` ^10.9.1 · `prettier` ^3 · `typescript` ^5 (peer deps)
|
|
137
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zirka",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.76",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"eslint-plugin-unicorn": "^73.0.0",
|
|
52
52
|
"globals": "^16.2.0",
|
|
53
53
|
"jiti": "^2.6.1",
|
|
54
|
-
"pasika": "^0.10.
|
|
54
|
+
"pasika": "^0.10.3",
|
|
55
55
|
"prettier-plugin-packagejson": "^2.5.14",
|
|
56
56
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
57
57
|
"typescript-eslint": "^8.68.0"
|