zirka 0.0.46 → 0.0.48

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 CHANGED
@@ -32,21 +32,21 @@ Each config block is loaded lazily — if you don't enable `react`, none of its
32
32
 
33
33
  ### What's included per block
34
34
 
35
- | Block | Globals | Rules |
36
- | ------------ | -------------------------- | -------------------------------------------------- |
37
- | `browser` | `window`, `document`, etc. | Base JS + import + prettier + unicorn |
38
- | `node` | `process`, `Buffer`, etc. | Base JS + import + prettier + unicorn |
39
- | `typescript` | — | `typescript-eslint` strict + stylistic, type-aware |
40
- | `react` | — | `@eslint-react`, `react-hooks`, `jsx-a11y` |
41
- | `next` | — | `@next/eslint-plugin-next` |
42
- | `playwright` | — | `eslint-plugin-playwright` |
43
- | `pasika` | — | Pasika rules over TS/TSX, CSS, Markdown, and JSON |
35
+ | Block | Globals | Rules |
36
+ | ----------------- | -------------------------- | -------------------------------------------------- |
37
+ | `browser` | `window`, `document`, etc. | Base JS + import + prettier + unicorn |
38
+ | `node` | `process`, `Buffer`, etc. | Base JS + import + prettier + unicorn |
39
+ | `typescript` | — | `typescript-eslint` strict + stylistic, type-aware |
40
+ | `react` | — | `@eslint-react`, `react-hooks`, `jsx-a11y` |
41
+ | `next` | — | `@next/eslint-plugin-next` |
42
+ | `playwright` | — | `eslint-plugin-playwright` | | `pasikaTypescriptApp` | — | Pasika rules for a plain TypeScript repository |
43
+ | `pasikaNextjsApp` | — | Pasika rules for a Next.js application |
44
44
 
45
45
  Base rules (always included with any block): `@eslint/js` recommended, `@eslint-community/eslint-plugin-eslint-comments`, `eslint-plugin-unicorn`, and the hand-written best-practice, ES6, possible-errors, stylistic, and variables rule sets.
46
46
 
47
- ### The `pasika` block
47
+ ### The pasika presets (`pasikaTypescriptApp` / `pasikaNextjsApp`)
48
48
 
49
- Enabling `pasika` wires four language-scoped rule sets (see the pasika README for the full rule tables):
49
+ Enabling a pasika preset wires four language-scoped rule sets (see the pasika README for the full rule tables):
50
50
 
51
51
  | Files | Rules |
52
52
  | ------------------------------------------ | ------------------------- |
@@ -55,7 +55,7 @@ Enabling `pasika` wires four language-scoped rule sets (see the pasika README fo
55
55
  | `**/*.md` (not `_templates/`) | `pasika/*` Markdown rules |
56
56
  | `package.json` | `pasika/*` JSON rules |
57
57
 
58
- The JS/TS base blocks (browser, node, typescript, react, next, playwright) are scoped to JS/TS files, so the pasika language blocks are never shadowed — CSS, Markdown, and JSON files are linted by their own rules.
58
+ `typescriptApp` is the plain-TypeScript-repository preset — the package.json manifest, the zirka configuration contract, the `src/**` TypeScript app source, and the docs. `nextjsApp` is everything in `typescriptApp` plus the Next.js-stack manifest requirement, the Next.js app source rules, and the Tailwind stylesheet rules. The JS/TS base blocks (browser, node, typescript, react, next, playwright) are scoped to JS/TS files, so the pasika language blocks are never shadowed — CSS, Markdown, and JSON files are linted by their own rules.
59
59
 
60
60
  ### `RuleSeverity`
61
61
 
@@ -68,18 +68,19 @@ The JS/TS base blocks (browser, node, typescript, react, next, playwright) are s
68
68
 
69
69
  ### Options
70
70
 
71
- | Option | Type | Description |
72
- | ------------------- | -------------------------------- | -------------------------------------------- |
73
- | `browser` | `RuleSeverity` | Browser globals |
74
- | `node` | `RuleSeverity` | Node.js globals |
75
- | `typescript` | `RuleSeverity` | TypeScript-ESLint strict rules |
76
- | `react` | `RuleSeverity` | React + JSX-a11y rules |
77
- | `next` | `RuleSeverity` | Next.js rules |
78
- | `pasika` | `RuleSeverity` | Pasika rules: TS/TSX + CSS + Markdown + JSON |
79
- | `playwright` | `RuleSeverity` | Playwright test rules |
80
- | `ignores` | `string[]` | Glob patterns to ignore |
81
- | `additionalConfigs` | `Linter.Config[]` | Extra flat config entries appended last |
82
- | `prettier` | `true \| { tailwind?: boolean }` | Enable Prettier config |
71
+ | Option | Type | Description |
72
+ | --------------------- | -------------------------------- | ---------------------------------------------- |
73
+ | `browser` | `RuleSeverity` | Browser globals |
74
+ | `node` | `RuleSeverity` | Node.js globals |
75
+ | `typescript` | `RuleSeverity` | TypeScript-ESLint strict rules |
76
+ | `react` | `RuleSeverity` | React + JSX-a11y rules |
77
+ | `next` | `RuleSeverity` | Next.js rules |
78
+ | `pasikaTypescriptApp` | `RuleSeverity` | Pasika rules for a plain TypeScript repository |
79
+ | `pasikaNextjsApp` | `RuleSeverity` | Pasika rules for a Next.js application |
80
+ | `playwright` | `RuleSeverity` | Playwright test rules |
81
+ | `ignores` | `string[]` | Glob patterns to ignore |
82
+ | `additionalConfigs` | `Linter.Config[]` | Extra flat config entries appended last |
83
+ | `prettier` | `true \| { tailwind?: boolean }` | Enable Prettier config |
83
84
 
84
85
  ---
85
86
 
@@ -1086,8 +1086,8 @@ __export(styleguide_exports, {
1086
1086
  });
1087
1087
  module.exports = __toCommonJS(styleguide_exports);
1088
1088
  function styleguide(options) {
1089
- const { browser, node, typescript, react: react2, next, pasika, playwright, prettier } = options;
1090
- const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ?? pasika ?? playwright;
1089
+ const { browser, node, typescript, react: react2, next, pasikaTypescriptApp, pasikaNextjsApp, playwright, prettier } = options;
1090
+ const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ?? pasikaTypescriptApp ?? pasikaNextjsApp ?? playwright;
1091
1091
  const prettierConfig = prettier ? getPrettierConfig(prettier) : void 0;
1092
1092
  if (!hasEslintOptions) {
1093
1093
  return { prettierConfig };
@@ -1118,26 +1118,37 @@ var init_styleguide = __esm({
1118
1118
  };
1119
1119
  JS_TS_FILES = [...JAVASCRIPT_FILES, ...TYPESCRIPT_FILES];
1120
1120
  scopeToJsTs = (configs) => configs.map((config) => config.files ? config : { files: JS_TS_FILES, ...config });
1121
- loadPasikaConfigs = async () => {
1121
+ loadPasikaConfigs = async (preset) => {
1122
1122
  const pasika = await import("pasika/eslint");
1123
- const pasikaJsTs = { rules: pasika.pasikaRules };
1124
- const next = pasika.pasikaNext;
1123
+ const app = pasika[preset];
1125
1124
  const sourceUnderSrc = {
1126
1125
  files: JS_TS_FILES,
1127
- plugins: { pasika: pasikaJsTs },
1126
+ plugins: { pasika: pasika.pasikaPlugin },
1128
1127
  rules: { "pasika/source-under-src": "error" }
1129
1128
  };
1130
- return [...next, sourceUnderSrc];
1129
+ return [...app, sourceUnderSrc];
1131
1130
  };
1132
1131
  loadEslintConfigs = async (options) => {
1133
- const { browser, node, typescript, react: react2, next, pasika, playwright, ignores, additionalConfigs = [] } = options;
1132
+ const {
1133
+ browser,
1134
+ node,
1135
+ typescript,
1136
+ react: react2,
1137
+ next,
1138
+ pasikaTypescriptApp,
1139
+ pasikaNextjsApp,
1140
+ playwright,
1141
+ ignores,
1142
+ additionalConfigs = []
1143
+ } = options;
1134
1144
  const configLoaders = [
1135
1145
  { loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
1136
1146
  { loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
1137
1147
  { loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
1138
1148
  { loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
1139
1149
  { loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
1140
- { loader: () => loadPasikaConfigs(), severity: pasika, isPasika: true },
1150
+ { loader: () => loadPasikaConfigs("typescriptApp"), severity: pasikaTypescriptApp, isPasika: true },
1151
+ { loader: () => loadPasikaConfigs("nextjsApp"), severity: pasikaNextjsApp, isPasika: true },
1141
1152
  { loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
1142
1153
  ];
1143
1154
  const eslintConfigs = [];
@@ -16,7 +16,8 @@ interface StyleguideOptions {
16
16
  typescript?: RuleSeverity;
17
17
  react?: RuleSeverity;
18
18
  next?: RuleSeverity;
19
- pasika?: RuleSeverity;
19
+ pasikaTypescriptApp?: RuleSeverity;
20
+ pasikaNextjsApp?: RuleSeverity;
20
21
  playwright?: RuleSeverity;
21
22
  ignores?: string[];
22
23
  additionalConfigs?: Linter.Config[];
@@ -16,7 +16,8 @@ interface StyleguideOptions {
16
16
  typescript?: RuleSeverity;
17
17
  react?: RuleSeverity;
18
18
  next?: RuleSeverity;
19
- pasika?: RuleSeverity;
19
+ pasikaTypescriptApp?: RuleSeverity;
20
+ pasikaNextjsApp?: RuleSeverity;
20
21
  playwright?: RuleSeverity;
21
22
  ignores?: string[];
22
23
  additionalConfigs?: Linter.Config[];
@@ -1064,8 +1064,8 @@ var init_playwright = __esm({
1064
1064
 
1065
1065
  // styleguide.ts
1066
1066
  function styleguide(options) {
1067
- const { browser, node, typescript, react: react2, next, pasika, playwright, prettier } = options;
1068
- const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ?? pasika ?? playwright;
1067
+ const { browser, node, typescript, react: react2, next, pasikaTypescriptApp, pasikaNextjsApp, playwright, prettier } = options;
1068
+ const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ?? pasikaTypescriptApp ?? pasikaNextjsApp ?? playwright;
1069
1069
  const prettierConfig = prettier ? getPrettierConfig(prettier) : void 0;
1070
1070
  if (!hasEslintOptions) {
1071
1071
  return { prettierConfig };
@@ -1096,26 +1096,37 @@ var init_styleguide = __esm({
1096
1096
  };
1097
1097
  JS_TS_FILES = [...JAVASCRIPT_FILES, ...TYPESCRIPT_FILES];
1098
1098
  scopeToJsTs = (configs) => configs.map((config) => config.files ? config : { files: JS_TS_FILES, ...config });
1099
- loadPasikaConfigs = async () => {
1099
+ loadPasikaConfigs = async (preset) => {
1100
1100
  const pasika = await import("pasika/eslint");
1101
- const pasikaJsTs = { rules: pasika.pasikaRules };
1102
- const next = pasika.pasikaNext;
1101
+ const app = pasika[preset];
1103
1102
  const sourceUnderSrc = {
1104
1103
  files: JS_TS_FILES,
1105
- plugins: { pasika: pasikaJsTs },
1104
+ plugins: { pasika: pasika.pasikaPlugin },
1106
1105
  rules: { "pasika/source-under-src": "error" }
1107
1106
  };
1108
- return [...next, sourceUnderSrc];
1107
+ return [...app, sourceUnderSrc];
1109
1108
  };
1110
1109
  loadEslintConfigs = async (options) => {
1111
- const { browser, node, typescript, react: react2, next, pasika, playwright, ignores, additionalConfigs = [] } = options;
1110
+ const {
1111
+ browser,
1112
+ node,
1113
+ typescript,
1114
+ react: react2,
1115
+ next,
1116
+ pasikaTypescriptApp,
1117
+ pasikaNextjsApp,
1118
+ playwright,
1119
+ ignores,
1120
+ additionalConfigs = []
1121
+ } = options;
1112
1122
  const configLoaders = [
1113
1123
  { loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
1114
1124
  { loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
1115
1125
  { loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
1116
1126
  { loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
1117
1127
  { loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
1118
- { loader: () => loadPasikaConfigs(), severity: pasika, isPasika: true },
1128
+ { loader: () => loadPasikaConfigs("typescriptApp"), severity: pasikaTypescriptApp, isPasika: true },
1129
+ { loader: () => loadPasikaConfigs("nextjsApp"), severity: pasikaNextjsApp, isPasika: true },
1119
1130
  { loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
1120
1131
  ];
1121
1132
  const eslintConfigs = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zirka",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
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.3.9",
54
+ "pasika": "^0.4.1",
55
55
  "prettier-plugin-packagejson": "^2.5.14",
56
56
  "prettier-plugin-tailwindcss": "^0.6.14",
57
57
  "typescript-eslint": "^8.68.0"