zirka 0.0.46 → 0.0.47
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 +25 -24
- package/dist/styleguide.cjs +19 -7
- package/dist/styleguide.d.cts +2 -1
- package/dist/styleguide.d.ts +2 -1
- package/dist/styleguide.js +19 -7
- package/package.json +2 -2
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
|
|
36
|
-
|
|
|
37
|
-
| `browser`
|
|
38
|
-
| `node`
|
|
39
|
-
| `typescript`
|
|
40
|
-
| `react`
|
|
41
|
-
| `next`
|
|
42
|
-
| `playwright`
|
|
43
|
-
| `
|
|
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
|
|
47
|
+
### The pasika presets (`pasikaTypescriptApp` / `pasikaNextjsApp`)
|
|
48
48
|
|
|
49
|
-
Enabling
|
|
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
|
|
72
|
-
|
|
|
73
|
-
| `browser`
|
|
74
|
-
| `node`
|
|
75
|
-
| `typescript`
|
|
76
|
-
| `react`
|
|
77
|
-
| `next`
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
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
|
|
package/dist/styleguide.cjs
CHANGED
|
@@ -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,
|
|
1090
|
-
const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ??
|
|
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,38 @@ 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
1123
|
const pasikaJsTs = { rules: pasika.pasikaRules };
|
|
1124
|
-
const
|
|
1124
|
+
const app = pasika[preset];
|
|
1125
1125
|
const sourceUnderSrc = {
|
|
1126
1126
|
files: JS_TS_FILES,
|
|
1127
1127
|
plugins: { pasika: pasikaJsTs },
|
|
1128
1128
|
rules: { "pasika/source-under-src": "error" }
|
|
1129
1129
|
};
|
|
1130
|
-
return [...
|
|
1130
|
+
return [...app, sourceUnderSrc];
|
|
1131
1131
|
};
|
|
1132
1132
|
loadEslintConfigs = async (options) => {
|
|
1133
|
-
const {
|
|
1133
|
+
const {
|
|
1134
|
+
browser,
|
|
1135
|
+
node,
|
|
1136
|
+
typescript,
|
|
1137
|
+
react: react2,
|
|
1138
|
+
next,
|
|
1139
|
+
pasikaTypescriptApp,
|
|
1140
|
+
pasikaNextjsApp,
|
|
1141
|
+
playwright,
|
|
1142
|
+
ignores,
|
|
1143
|
+
additionalConfigs = []
|
|
1144
|
+
} = options;
|
|
1134
1145
|
const configLoaders = [
|
|
1135
1146
|
{ loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
|
|
1136
1147
|
{ loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
|
|
1137
1148
|
{ loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
|
|
1138
1149
|
{ loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
|
|
1139
1150
|
{ loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
|
|
1140
|
-
{ loader: () => loadPasikaConfigs(), severity:
|
|
1151
|
+
{ loader: () => loadPasikaConfigs("typescriptApp"), severity: pasikaTypescriptApp, isPasika: true },
|
|
1152
|
+
{ loader: () => loadPasikaConfigs("nextjsApp"), severity: pasikaNextjsApp, isPasika: true },
|
|
1141
1153
|
{ loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
|
|
1142
1154
|
];
|
|
1143
1155
|
const eslintConfigs = [];
|
package/dist/styleguide.d.cts
CHANGED
|
@@ -16,7 +16,8 @@ interface StyleguideOptions {
|
|
|
16
16
|
typescript?: RuleSeverity;
|
|
17
17
|
react?: RuleSeverity;
|
|
18
18
|
next?: RuleSeverity;
|
|
19
|
-
|
|
19
|
+
pasikaTypescriptApp?: RuleSeverity;
|
|
20
|
+
pasikaNextjsApp?: RuleSeverity;
|
|
20
21
|
playwright?: RuleSeverity;
|
|
21
22
|
ignores?: string[];
|
|
22
23
|
additionalConfigs?: Linter.Config[];
|
package/dist/styleguide.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ interface StyleguideOptions {
|
|
|
16
16
|
typescript?: RuleSeverity;
|
|
17
17
|
react?: RuleSeverity;
|
|
18
18
|
next?: RuleSeverity;
|
|
19
|
-
|
|
19
|
+
pasikaTypescriptApp?: RuleSeverity;
|
|
20
|
+
pasikaNextjsApp?: RuleSeverity;
|
|
20
21
|
playwright?: RuleSeverity;
|
|
21
22
|
ignores?: string[];
|
|
22
23
|
additionalConfigs?: Linter.Config[];
|
package/dist/styleguide.js
CHANGED
|
@@ -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,
|
|
1068
|
-
const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ??
|
|
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,38 @@ 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
1101
|
const pasikaJsTs = { rules: pasika.pasikaRules };
|
|
1102
|
-
const
|
|
1102
|
+
const app = pasika[preset];
|
|
1103
1103
|
const sourceUnderSrc = {
|
|
1104
1104
|
files: JS_TS_FILES,
|
|
1105
1105
|
plugins: { pasika: pasikaJsTs },
|
|
1106
1106
|
rules: { "pasika/source-under-src": "error" }
|
|
1107
1107
|
};
|
|
1108
|
-
return [...
|
|
1108
|
+
return [...app, sourceUnderSrc];
|
|
1109
1109
|
};
|
|
1110
1110
|
loadEslintConfigs = async (options) => {
|
|
1111
|
-
const {
|
|
1111
|
+
const {
|
|
1112
|
+
browser,
|
|
1113
|
+
node,
|
|
1114
|
+
typescript,
|
|
1115
|
+
react: react2,
|
|
1116
|
+
next,
|
|
1117
|
+
pasikaTypescriptApp,
|
|
1118
|
+
pasikaNextjsApp,
|
|
1119
|
+
playwright,
|
|
1120
|
+
ignores,
|
|
1121
|
+
additionalConfigs = []
|
|
1122
|
+
} = options;
|
|
1112
1123
|
const configLoaders = [
|
|
1113
1124
|
{ loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
|
|
1114
1125
|
{ loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
|
|
1115
1126
|
{ loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
|
|
1116
1127
|
{ loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
|
|
1117
1128
|
{ loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
|
|
1118
|
-
{ loader: () => loadPasikaConfigs(), severity:
|
|
1129
|
+
{ loader: () => loadPasikaConfigs("typescriptApp"), severity: pasikaTypescriptApp, isPasika: true },
|
|
1130
|
+
{ loader: () => loadPasikaConfigs("nextjsApp"), severity: pasikaNextjsApp, isPasika: true },
|
|
1119
1131
|
{ loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
|
|
1120
1132
|
];
|
|
1121
1133
|
const eslintConfigs = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zirka",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
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.
|
|
54
|
+
"pasika": "^0.4.0",
|
|
55
55
|
"prettier-plugin-packagejson": "^2.5.14",
|
|
56
56
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
57
57
|
"typescript-eslint": "^8.68.0"
|