zirka 0.0.35 → 0.0.37

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.
@@ -1263,7 +1263,7 @@ function styleguide(options) {
1263
1263
  prettierConfig
1264
1264
  };
1265
1265
  }
1266
- var RuleSeverity, applySeverity, loadEslintConfigs;
1266
+ var RuleSeverity, applySeverity, getProperty, setProperty, injectAllowDefaultProject, loadEslintConfigs;
1267
1267
  var init_styleguide = __esm({
1268
1268
  "styleguide.ts"() {
1269
1269
  init_prettier_config();
@@ -1280,8 +1280,38 @@ var init_styleguide = __esm({
1280
1280
  const { transformSeverity: transformSeverity2 } = await Promise.resolve().then(() => (init_transform_severity(), transform_severity_exports));
1281
1281
  return transformSeverity2(config, severity);
1282
1282
  };
1283
+ getProperty = (obj, key) => {
1284
+ const desc = Object.getOwnPropertyDescriptor(obj, key);
1285
+ return desc?.value;
1286
+ };
1287
+ setProperty = (obj, key, value) => {
1288
+ Object.defineProperty(obj, key, { value, writable: true, enumerable: true, configurable: true });
1289
+ };
1290
+ injectAllowDefaultProject = (entry, allowDefaultProject) => {
1291
+ const langOpts = entry.languageOptions;
1292
+ if (!langOpts || typeof langOpts !== "object") return;
1293
+ const parserOpts = getProperty(langOpts, "parserOptions");
1294
+ if (!parserOpts || typeof parserOpts !== "object") return;
1295
+ const ps = getProperty(parserOpts, "projectService");
1296
+ if (ps === true) {
1297
+ setProperty(parserOpts, "projectService", { allowDefaultProject });
1298
+ } else if (ps && typeof ps === "object") {
1299
+ setProperty(ps, "allowDefaultProject", allowDefaultProject);
1300
+ }
1301
+ };
1283
1302
  loadEslintConfigs = async (options) => {
1284
- const { browser, node, typescript, react: react2, next, pasika, playwright, ignores, additionalConfigs = [] } = options;
1303
+ const {
1304
+ browser,
1305
+ node,
1306
+ typescript,
1307
+ react: react2,
1308
+ next,
1309
+ pasika,
1310
+ playwright,
1311
+ ignores,
1312
+ allowDefaultProject = ["eslint.config.ts"],
1313
+ additionalConfigs = []
1314
+ } = options;
1285
1315
  const configLoaders = [
1286
1316
  { loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
1287
1317
  { loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
@@ -1299,6 +1329,11 @@ var init_styleguide = __esm({
1299
1329
  eslintConfigs.push(...processedConfig);
1300
1330
  }
1301
1331
  }
1332
+ if (allowDefaultProject.length > 0) {
1333
+ for (const entry of eslintConfigs) {
1334
+ injectAllowDefaultProject(entry, allowDefaultProject);
1335
+ }
1336
+ }
1302
1337
  if (ignores && ignores.length > 0) {
1303
1338
  eslintConfigs.push({ ignores });
1304
1339
  }
@@ -19,6 +19,7 @@ interface StyleguideOptions {
19
19
  pasika?: RuleSeverity;
20
20
  playwright?: RuleSeverity;
21
21
  ignores?: string[];
22
+ allowDefaultProject?: string[];
22
23
  additionalConfigs?: Linter.Config[];
23
24
  prettier?: PrettierOptions | true;
24
25
  }
@@ -19,6 +19,7 @@ interface StyleguideOptions {
19
19
  pasika?: RuleSeverity;
20
20
  playwright?: RuleSeverity;
21
21
  ignores?: string[];
22
+ allowDefaultProject?: string[];
22
23
  additionalConfigs?: Linter.Config[];
23
24
  prettier?: PrettierOptions | true;
24
25
  }
@@ -1241,7 +1241,7 @@ function styleguide(options) {
1241
1241
  prettierConfig
1242
1242
  };
1243
1243
  }
1244
- var RuleSeverity, applySeverity, loadEslintConfigs;
1244
+ var RuleSeverity, applySeverity, getProperty, setProperty, injectAllowDefaultProject, loadEslintConfigs;
1245
1245
  var init_styleguide = __esm({
1246
1246
  "styleguide.ts"() {
1247
1247
  init_prettier_config();
@@ -1258,8 +1258,38 @@ var init_styleguide = __esm({
1258
1258
  const { transformSeverity: transformSeverity2 } = await Promise.resolve().then(() => (init_transform_severity(), transform_severity_exports));
1259
1259
  return transformSeverity2(config, severity);
1260
1260
  };
1261
+ getProperty = (obj, key) => {
1262
+ const desc = Object.getOwnPropertyDescriptor(obj, key);
1263
+ return desc?.value;
1264
+ };
1265
+ setProperty = (obj, key, value) => {
1266
+ Object.defineProperty(obj, key, { value, writable: true, enumerable: true, configurable: true });
1267
+ };
1268
+ injectAllowDefaultProject = (entry, allowDefaultProject) => {
1269
+ const langOpts = entry.languageOptions;
1270
+ if (!langOpts || typeof langOpts !== "object") return;
1271
+ const parserOpts = getProperty(langOpts, "parserOptions");
1272
+ if (!parserOpts || typeof parserOpts !== "object") return;
1273
+ const ps = getProperty(parserOpts, "projectService");
1274
+ if (ps === true) {
1275
+ setProperty(parserOpts, "projectService", { allowDefaultProject });
1276
+ } else if (ps && typeof ps === "object") {
1277
+ setProperty(ps, "allowDefaultProject", allowDefaultProject);
1278
+ }
1279
+ };
1261
1280
  loadEslintConfigs = async (options) => {
1262
- const { browser, node, typescript, react: react2, next, pasika, playwright, ignores, additionalConfigs = [] } = options;
1281
+ const {
1282
+ browser,
1283
+ node,
1284
+ typescript,
1285
+ react: react2,
1286
+ next,
1287
+ pasika,
1288
+ playwright,
1289
+ ignores,
1290
+ allowDefaultProject = ["eslint.config.ts"],
1291
+ additionalConfigs = []
1292
+ } = options;
1263
1293
  const configLoaders = [
1264
1294
  { loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
1265
1295
  { loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
@@ -1277,6 +1307,11 @@ var init_styleguide = __esm({
1277
1307
  eslintConfigs.push(...processedConfig);
1278
1308
  }
1279
1309
  }
1310
+ if (allowDefaultProject.length > 0) {
1311
+ for (const entry of eslintConfigs) {
1312
+ injectAllowDefaultProject(entry, allowDefaultProject);
1313
+ }
1314
+ }
1280
1315
  if (ignores && ignores.length > 0) {
1281
1316
  eslintConfigs.push({ ignores });
1282
1317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zirka",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,10 +52,10 @@
52
52
  "eslint-plugin-unicorn": "^59.0.1",
53
53
  "globals": "^16.2.0",
54
54
  "jiti": "^2.6.1",
55
+ "pasika": "^0.1.6",
55
56
  "prettier-plugin-packagejson": "^2.5.14",
56
57
  "prettier-plugin-tailwindcss": "^0.6.14",
57
- "typescript-eslint": "^8.33.1",
58
- "pasika": "^0.1.6"
58
+ "typescript-eslint": "^8.33.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "eslint": "^9.27.0",
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "compilerOptions": {
4
+ "target": "ES2022",
5
+ "module": "ES2022",
6
+ "moduleResolution": "Bundler",
7
+ "lib": ["ES2022"],
8
+ "types": ["node"],
4
9
  "strict": true,
5
10
  "esModuleInterop": true,
6
11
  "skipLibCheck": true,
7
12
  "forceConsistentCasingInFileNames": true,
8
13
  "noFallthroughCasesInSwitch": true,
9
14
  "noUncheckedIndexedAccess": true,
15
+ "noEmitOnError": true,
10
16
  "resolveJsonModule": true
11
17
  }
12
18
  }