zirka 0.0.41 → 0.0.43

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
@@ -40,8 +40,22 @@ Each config block is loaded lazily — if you don't enable `react`, none of its
40
40
  | `react` | — | `@eslint-react`, `react-hooks`, `jsx-a11y` |
41
41
  | `next` | — | `@next/eslint-plugin-next` |
42
42
  | `playwright` | — | `eslint-plugin-playwright` |
43
+ | `pasika` | — | Pasika rules over TS/TSX, CSS, Markdown, and JSON |
43
44
 
44
- Base rules (always included with any block): `@eslint/js` recommended, `eslint-plugin-import`, `eslint-plugin-prettier`, `eslint-plugin-unicorn`, `eslint-comments`.
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
+
47
+ ### The `pasika` block
48
+
49
+ Enabling `pasika` wires four language-scoped rule sets (see the pasika README for the full rule tables):
50
+
51
+ | Files | Rules |
52
+ | ------------------------------------------ | ------------------------- |
53
+ | `src/**/*.{js,jsx,ts,tsx,mjs,mts,cjs,cts}` | `pasika/*` TS/TSX rules |
54
+ | `src/**/globals.css`, `src/**/*.css` | `pasika/*` CSS rules |
55
+ | `**/*.md` (not `_templates/`) | `pasika/*` Markdown rules |
56
+ | `package.json` | `pasika/*` JSON rules |
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.
45
59
 
46
60
  ### `RuleSeverity`
47
61
 
@@ -54,18 +68,18 @@ Base rules (always included with any block): `@eslint/js` recommended, `eslint-p
54
68
 
55
69
  ### Options
56
70
 
57
- | Option | Type | Description |
58
- | ------------------- | -------------------------------- | --------------------------------------- |
59
- | `browser` | `RuleSeverity` | Browser globals |
60
- | `node` | `RuleSeverity` | Node.js globals |
61
- | `typescript` | `RuleSeverity` | TypeScript-ESLint strict rules |
62
- | `react` | `RuleSeverity` | React + JSX-a11y rules |
63
- | `next` | `RuleSeverity` | Next.js rules |
64
- | `pasika` | `RuleSeverity` | Pasika code-organization rules |
65
- | `playwright` | `RuleSeverity` | Playwright test rules |
66
- | `ignores` | `string[]` | Glob patterns to ignore |
67
- | `additionalConfigs` | `Linter.Config[]` | Extra flat config entries appended last |
68
- | `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
+ | `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 |
69
83
 
70
84
  ---
71
85
 
@@ -129,4 +143,4 @@ The base config only sets strictness flags — no environment-specific settings.
129
143
  ## Requirements
130
144
 
131
145
  - Node ≥ 22
132
- - `eslint` ^9 · `prettier` ^3 · `typescript` ^5 (peer deps)
146
+ - `eslint` ^10.9.1 · `prettier` ^3 · `typescript` ^5 (peer deps)
@@ -56,6 +56,17 @@ var init_prettier_config = __esm({
56
56
  }
57
57
  });
58
58
 
59
+ // eslint/utils/constants.ts
60
+ var ECMA_VERSION, JAVASCRIPT_FILES, TYPESCRIPT_FILES;
61
+ var init_constants = __esm({
62
+ "eslint/utils/constants.ts"() {
63
+ "use strict";
64
+ ECMA_VERSION = "latest";
65
+ JAVASCRIPT_FILES = ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"];
66
+ TYPESCRIPT_FILES = ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"];
67
+ }
68
+ });
69
+
59
70
  // eslint/utils/transform-severity.ts
60
71
  var transform_severity_exports = {};
61
72
  __export(transform_severity_exports, {
@@ -99,17 +110,6 @@ var init_transform_severity = __esm({
99
110
  }
100
111
  });
101
112
 
102
- // eslint/utils/constants.ts
103
- var ECMA_VERSION, JAVASCRIPT_FILES, TYPESCRIPT_FILES;
104
- var init_constants = __esm({
105
- "eslint/utils/constants.ts"() {
106
- "use strict";
107
- ECMA_VERSION = "latest";
108
- JAVASCRIPT_FILES = ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"];
109
- TYPESCRIPT_FILES = ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"];
110
- }
111
- });
112
-
113
113
  // eslint/rules/best-practice.ts
114
114
  var bestPracticeRules;
115
115
  var init_best_practice = __esm({
@@ -1098,10 +1098,11 @@ function styleguide(options) {
1098
1098
  prettierConfig
1099
1099
  };
1100
1100
  }
1101
- var RuleSeverity, applySeverity, loadPasikaConfigs, loadEslintConfigs;
1101
+ var RuleSeverity, applySeverity, JS_TS_FILES, scopeToJsTs, loadPasikaConfigs, loadEslintConfigs;
1102
1102
  var init_styleguide = __esm({
1103
1103
  "styleguide.ts"() {
1104
1104
  init_prettier_config();
1105
+ init_constants();
1105
1106
  RuleSeverity = /* @__PURE__ */ ((RuleSeverity2) => {
1106
1107
  RuleSeverity2["Off"] = "off";
1107
1108
  RuleSeverity2["Warn"] = "warn";
@@ -1115,6 +1116,8 @@ var init_styleguide = __esm({
1115
1116
  const { transformSeverity: transformSeverity2 } = await Promise.resolve().then(() => (init_transform_severity(), transform_severity_exports));
1116
1117
  return transformSeverity2(config, severity);
1117
1118
  };
1119
+ JS_TS_FILES = [...JAVASCRIPT_FILES, ...TYPESCRIPT_FILES];
1120
+ scopeToJsTs = (configs) => configs.map((config) => config.files ? config : { files: JS_TS_FILES, ...config });
1118
1121
  loadPasikaConfigs = async () => {
1119
1122
  const [pasika, cssMod, jsonMod, markdownMod] = await Promise.all([
1120
1123
  import("pasika/eslint"),
@@ -1129,7 +1132,6 @@ var init_styleguide = __esm({
1129
1132
  const pasikaCss = { rules: pasika.cssRules };
1130
1133
  const pasikaJson = { rules: pasika.jsonRules };
1131
1134
  return [
1132
- { ignores: ["**/*.css", "package.json", "**/*.md"] },
1133
1135
  {
1134
1136
  files: ["src/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}"],
1135
1137
  plugins: { pasika: pasikaJsTs },
@@ -1177,14 +1179,15 @@ var init_styleguide = __esm({
1177
1179
  { loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
1178
1180
  { loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
1179
1181
  { loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
1180
- { loader: () => loadPasikaConfigs(), severity: pasika },
1182
+ { loader: () => loadPasikaConfigs(), severity: pasika, isPasika: true },
1181
1183
  { loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
1182
1184
  ];
1183
1185
  const eslintConfigs = [];
1184
- for (const { loader, severity } of configLoaders) {
1186
+ for (const { loader, severity, isPasika } of configLoaders) {
1185
1187
  if (severity && severity !== "off" /* Off */) {
1186
1188
  const config = await loader();
1187
- const processedConfig = await applySeverity(config, severity);
1189
+ const scopedConfig = isPasika ? config : scopeToJsTs(config);
1190
+ const processedConfig = await applySeverity(scopedConfig, severity);
1188
1191
  eslintConfigs.push(...processedConfig);
1189
1192
  }
1190
1193
  }
@@ -40,6 +40,17 @@ var init_prettier_config = __esm({
40
40
  }
41
41
  });
42
42
 
43
+ // eslint/utils/constants.ts
44
+ var ECMA_VERSION, JAVASCRIPT_FILES, TYPESCRIPT_FILES;
45
+ var init_constants = __esm({
46
+ "eslint/utils/constants.ts"() {
47
+ "use strict";
48
+ ECMA_VERSION = "latest";
49
+ JAVASCRIPT_FILES = ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"];
50
+ TYPESCRIPT_FILES = ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"];
51
+ }
52
+ });
53
+
43
54
  // eslint/utils/transform-severity.ts
44
55
  var transform_severity_exports = {};
45
56
  __export(transform_severity_exports, {
@@ -83,17 +94,6 @@ var init_transform_severity = __esm({
83
94
  }
84
95
  });
85
96
 
86
- // eslint/utils/constants.ts
87
- var ECMA_VERSION, JAVASCRIPT_FILES, TYPESCRIPT_FILES;
88
- var init_constants = __esm({
89
- "eslint/utils/constants.ts"() {
90
- "use strict";
91
- ECMA_VERSION = "latest";
92
- JAVASCRIPT_FILES = ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"];
93
- TYPESCRIPT_FILES = ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"];
94
- }
95
- });
96
-
97
97
  // eslint/rules/best-practice.ts
98
98
  var bestPracticeRules;
99
99
  var init_best_practice = __esm({
@@ -1076,10 +1076,11 @@ function styleguide(options) {
1076
1076
  prettierConfig
1077
1077
  };
1078
1078
  }
1079
- var RuleSeverity, applySeverity, loadPasikaConfigs, loadEslintConfigs;
1079
+ var RuleSeverity, applySeverity, JS_TS_FILES, scopeToJsTs, loadPasikaConfigs, loadEslintConfigs;
1080
1080
  var init_styleguide = __esm({
1081
1081
  "styleguide.ts"() {
1082
1082
  init_prettier_config();
1083
+ init_constants();
1083
1084
  RuleSeverity = /* @__PURE__ */ ((RuleSeverity2) => {
1084
1085
  RuleSeverity2["Off"] = "off";
1085
1086
  RuleSeverity2["Warn"] = "warn";
@@ -1093,6 +1094,8 @@ var init_styleguide = __esm({
1093
1094
  const { transformSeverity: transformSeverity2 } = await Promise.resolve().then(() => (init_transform_severity(), transform_severity_exports));
1094
1095
  return transformSeverity2(config, severity);
1095
1096
  };
1097
+ JS_TS_FILES = [...JAVASCRIPT_FILES, ...TYPESCRIPT_FILES];
1098
+ scopeToJsTs = (configs) => configs.map((config) => config.files ? config : { files: JS_TS_FILES, ...config });
1096
1099
  loadPasikaConfigs = async () => {
1097
1100
  const [pasika, cssMod, jsonMod, markdownMod] = await Promise.all([
1098
1101
  import("pasika/eslint"),
@@ -1107,7 +1110,6 @@ var init_styleguide = __esm({
1107
1110
  const pasikaCss = { rules: pasika.cssRules };
1108
1111
  const pasikaJson = { rules: pasika.jsonRules };
1109
1112
  return [
1110
- { ignores: ["**/*.css", "package.json", "**/*.md"] },
1111
1113
  {
1112
1114
  files: ["src/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}"],
1113
1115
  plugins: { pasika: pasikaJsTs },
@@ -1155,14 +1157,15 @@ var init_styleguide = __esm({
1155
1157
  { loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
1156
1158
  { loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
1157
1159
  { loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
1158
- { loader: () => loadPasikaConfigs(), severity: pasika },
1160
+ { loader: () => loadPasikaConfigs(), severity: pasika, isPasika: true },
1159
1161
  { loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
1160
1162
  ];
1161
1163
  const eslintConfigs = [];
1162
- for (const { loader, severity } of configLoaders) {
1164
+ for (const { loader, severity, isPasika } of configLoaders) {
1163
1165
  if (severity && severity !== "off" /* Off */) {
1164
1166
  const config = await loader();
1165
- const processedConfig = await applySeverity(config, severity);
1167
+ const scopedConfig = isPasika ? config : scopeToJsTs(config);
1168
+ const processedConfig = await applySeverity(scopedConfig, severity);
1166
1169
  eslintConfigs.push(...processedConfig);
1167
1170
  }
1168
1171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zirka",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +0,0 @@
1
- declare module "@eslint-community/eslint-plugin-eslint-comments/configs" {
2
- import type { Linter } from "eslint";
3
-
4
- const recommended: Linter.Config;
5
- }
@@ -1,7 +0,0 @@
1
- declare module "eslint-plugin-import" {
2
- import type { Linter } from "eslint";
3
-
4
- const flatConfigs: {
5
- recommended: Linter.Config;
6
- };
7
- }