@hublo/sentinel 1.1.0-alpha.2 → 1.1.0-alpha.3

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.
@@ -14,7 +14,7 @@ import {
14
14
  registerAdapters,
15
15
  resolve,
16
16
  resolveBin
17
- } from "../chunk-EZCRU6XE.js";
17
+ } from "../chunk-QPT6V2GK.js";
18
18
 
19
19
  // bin/sentinel.ts
20
20
  import { program } from "commander";
@@ -390,81 +390,95 @@ function disabledRulesFor(flavour) {
390
390
  return BY_FLAVOUR[flavour] ?? [];
391
391
  }
392
392
 
393
+ // src/roles/lint/downgraded-rules.ts
394
+ var NEST_DOWNGRADED = [
395
+ {
396
+ rule: "import-js/order",
397
+ reason: "was error in the module config, but the lint target only ever checked 2 files of 2888, so the 23 violations were never reported; held at warn so adoption does not turn a green module red, and restored once they are fixed"
398
+ }
399
+ ];
400
+ var BY_FLAVOUR2 = {
401
+ nest: NEST_DOWNGRADED
402
+ };
403
+ function downgradedRulesFor(flavour) {
404
+ return BY_FLAVOUR2[flavour] ?? [];
405
+ }
406
+
393
407
  // src/roles/lint/flavours/base.ts
394
408
  var lintBase = {
395
409
  // typescript-eslint (17)
396
- "typescript/ban-ts-comment": "warn",
397
- "typescript/no-array-constructor": "warn",
398
- "typescript/no-duplicate-enum-values": "warn",
399
- "typescript/no-empty-object-type": "warn",
400
- "typescript/no-extra-non-null-assertion": "warn",
401
- "typescript/no-misused-new": "warn",
402
- "typescript/no-namespace": "warn",
403
- "typescript/no-non-null-asserted-optional-chain": "warn",
404
- "typescript/no-this-alias": "warn",
405
- "typescript/no-unnecessary-type-constraint": "warn",
406
- "typescript/no-unsafe-declaration-merging": "warn",
407
- "typescript/no-unsafe-function-type": "warn",
410
+ "typescript/ban-ts-comment": "error",
411
+ "typescript/no-array-constructor": "error",
412
+ "typescript/no-duplicate-enum-values": "error",
413
+ "typescript/no-empty-object-type": "error",
414
+ "typescript/no-extra-non-null-assertion": "error",
415
+ "typescript/no-misused-new": "error",
416
+ "typescript/no-namespace": "error",
417
+ "typescript/no-non-null-asserted-optional-chain": "error",
418
+ "typescript/no-this-alias": "error",
419
+ "typescript/no-unnecessary-type-constraint": "error",
420
+ "typescript/no-unsafe-declaration-merging": "error",
421
+ "typescript/no-unsafe-function-type": "error",
408
422
  "typescript/no-unused-expressions": [
409
- "warn",
423
+ "error",
410
424
  { allowShortCircuit: false, allowTaggedTemplates: false, allowTernary: false }
411
425
  ],
412
- "typescript/no-wrapper-object-types": "warn",
413
- "typescript/prefer-as-const": "warn",
414
- "typescript/prefer-namespace-keyword": "warn",
415
- "typescript/triple-slash-reference": "warn",
426
+ "typescript/no-wrapper-object-types": "error",
427
+ "typescript/prefer-as-const": "error",
428
+ "typescript/prefer-namespace-keyword": "error",
429
+ "typescript/triple-slash-reference": "error",
416
430
  // ESLint core (4)
417
- "no-var": "warn",
418
- "prefer-const": ["warn", { destructuring: "any", ignoreReadBeforeAssign: false }],
419
- "prefer-rest-params": "warn",
420
- "prefer-spread": "warn"
431
+ "no-var": "error",
432
+ "prefer-const": ["error", { destructuring: "any", ignoreReadBeforeAssign: false }],
433
+ "prefer-rest-params": "error",
434
+ "prefer-spread": "error"
421
435
  };
422
436
 
423
437
  // src/roles/lint/flavours/nest.ts
424
438
  var nestLayer = {
425
439
  // ESLint core (55)
426
440
  "array-callback-return": [
427
- "warn",
441
+ "error",
428
442
  { allowImplicit: false, checkForEach: false, allowVoid: false }
429
443
  ],
430
- complexity: ["warn", 30],
431
- curly: ["warn", "all"],
432
- "dot-notation": ["warn", { allowKeywords: true, allowPattern: "" }],
433
- eqeqeq: "warn",
434
- "for-direction": "warn",
444
+ complexity: ["error", 30],
445
+ curly: ["error", "all"],
446
+ "dot-notation": ["error", { allowKeywords: true, allowPattern: "" }],
447
+ eqeqeq: "error",
448
+ "for-direction": "error",
435
449
  "func-style": [
436
- "warn",
450
+ "error",
437
451
  "expression",
438
452
  { allowArrowFunctions: false, allowTypeAnnotation: false, overrides: {} }
439
453
  ],
440
- "no-async-promise-executor": "warn",
441
- "no-case-declarations": "warn",
442
- "no-compare-neg-zero": "warn",
443
- "no-cond-assign": ["warn", "except-parens"],
444
- "no-console": ["warn", { allow: ["warn", "error"] }],
445
- "no-constant-binary-expression": "warn",
446
- "no-constant-condition": ["warn", { checkLoops: "allExceptWhileTrue" }],
447
- "no-debugger": "warn",
448
- "no-delete-var": "warn",
449
- "no-dupe-else-if": "warn",
450
- "no-dupe-keys": "warn",
451
- "no-duplicate-case": "warn",
452
- "no-else-return": ["warn", { allowElseIf: true }],
453
- "no-empty": ["warn", { allowEmptyCatch: false }],
454
- "no-empty-character-class": "warn",
455
- "no-empty-pattern": ["warn", { allowObjectPatternsAsParameters: false }],
456
- "no-empty-static-block": "warn",
457
- "no-ex-assign": "warn",
458
- "no-extra-boolean-cast": ["warn", {}],
459
- "no-fallthrough": ["warn", { allowEmptyCase: false, reportUnusedFallthroughComment: false }],
460
- "no-global-assign": ["warn", { exceptions: [] }],
454
+ "no-async-promise-executor": "error",
455
+ "no-case-declarations": "error",
456
+ "no-compare-neg-zero": "error",
457
+ "no-cond-assign": ["error", "except-parens"],
458
+ "no-console": ["error", { allow: ["warn", "error"] }],
459
+ "no-constant-binary-expression": "error",
460
+ "no-constant-condition": ["error", { checkLoops: "allExceptWhileTrue" }],
461
+ "no-debugger": "error",
462
+ "no-delete-var": "error",
463
+ "no-dupe-else-if": "error",
464
+ "no-dupe-keys": "error",
465
+ "no-duplicate-case": "error",
466
+ "no-else-return": ["error", { allowElseIf: true }],
467
+ "no-empty": ["error", { allowEmptyCatch: false }],
468
+ "no-empty-character-class": "error",
469
+ "no-empty-pattern": ["error", { allowObjectPatternsAsParameters: false }],
470
+ "no-empty-static-block": "error",
471
+ "no-ex-assign": "error",
472
+ "no-extra-boolean-cast": ["error", {}],
473
+ "no-fallthrough": ["error", { allowEmptyCase: false, reportUnusedFallthroughComment: false }],
474
+ "no-global-assign": ["error", { exceptions: [] }],
461
475
  "no-implicit-coercion": [
462
- "warn",
476
+ "error",
463
477
  { allow: [], boolean: true, disallowTemplateShorthand: false, number: true, string: true }
464
478
  ],
465
- "no-invalid-regexp": ["warn", {}],
479
+ "no-invalid-regexp": ["error", {}],
466
480
  "no-irregular-whitespace": [
467
- "warn",
481
+ "error",
468
482
  {
469
483
  skipComments: false,
470
484
  skipJSXText: false,
@@ -473,14 +487,14 @@ var nestLayer = {
473
487
  skipTemplates: false
474
488
  }
475
489
  ],
476
- "no-lonely-if": "warn",
477
- "no-loss-of-precision": "warn",
478
- "no-misleading-character-class": "warn",
479
- "no-nonoctal-decimal-escape": "warn",
480
- "no-prototype-builtins": "warn",
481
- "no-regex-spaces": "warn",
490
+ "no-lonely-if": "error",
491
+ "no-loss-of-precision": "error",
492
+ "no-misleading-character-class": "error",
493
+ "no-nonoctal-decimal-escape": "error",
494
+ "no-prototype-builtins": "error",
495
+ "no-regex-spaces": "error",
482
496
  "no-restricted-imports": [
483
- "warn",
497
+ "error",
484
498
  {
485
499
  paths: [
486
500
  {
@@ -505,59 +519,59 @@ var nestLayer = {
505
519
  ]
506
520
  }
507
521
  ],
508
- "no-self-assign": ["warn", { props: true }],
509
- "no-shadow-restricted-names": ["warn", { reportGlobalThis: false }],
510
- "no-sparse-arrays": "warn",
511
- "no-unneeded-ternary": ["warn", { defaultAssignment: true }],
512
- "no-unsafe-finally": "warn",
513
- "no-unsafe-optional-chaining": ["warn", { disallowArithmeticOperators: false }],
514
- "no-unused-labels": "warn",
515
- "no-unused-private-class-members": "warn",
516
- "no-useless-backreference": "warn",
517
- "no-useless-catch": "warn",
518
- "no-useless-escape": ["warn", { allowRegexCharacters: [] }],
519
- "no-useless-return": "warn",
520
- "prefer-arrow-callback": ["warn", { allowNamedFunctions: false, allowUnboundThis: true }],
521
- "require-yield": "warn",
522
- "use-isnan": ["warn", { enforceForIndexOf: false, enforceForSwitchCase: true }],
523
- "valid-typeof": ["warn", { requireStringLiterals: false }],
522
+ "no-self-assign": ["error", { props: true }],
523
+ "no-shadow-restricted-names": ["error", { reportGlobalThis: false }],
524
+ "no-sparse-arrays": "error",
525
+ "no-unneeded-ternary": ["error", { defaultAssignment: true }],
526
+ "no-unsafe-finally": "error",
527
+ "no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: false }],
528
+ "no-unused-labels": "error",
529
+ "no-unused-private-class-members": "error",
530
+ "no-useless-backreference": "error",
531
+ "no-useless-catch": "error",
532
+ "no-useless-escape": ["error", { allowRegexCharacters: [] }],
533
+ "no-useless-return": "error",
534
+ "prefer-arrow-callback": ["error", { allowNamedFunctions: false, allowUnboundThis: true }],
535
+ "require-yield": "error",
536
+ "use-isnan": ["error", { enforceForIndexOf: false, enforceForSwitchCase: true }],
537
+ "valid-typeof": ["error", { requireStringLiterals: false }],
524
538
  // typescript-eslint (10)
525
- "typescript/await-thenable": "warn",
526
- "typescript/no-confusing-non-null-assertion": "warn",
527
- "typescript/no-empty-function": ["warn", { allow: [] }],
528
- "typescript/no-explicit-any": "warn",
529
- "typescript/no-floating-promises": ["warn", { ignoreVoid: true }],
530
- "typescript/no-import-type-side-effects": "warn",
531
- "typescript/no-inferrable-types": "warn",
532
- "typescript/no-non-null-assertion": "warn",
533
- "typescript/no-unused-vars": ["warn", { argsIgnorePattern: "^_", caughtErrors: "none" }],
534
- "typescript/switch-exhaustiveness-check": ["warn", { considerDefaultExhaustiveForUnions: true }],
539
+ "typescript/await-thenable": "error",
540
+ "typescript/no-confusing-non-null-assertion": "error",
541
+ "typescript/no-empty-function": ["error", { allow: [] }],
542
+ "typescript/no-explicit-any": "error",
543
+ "typescript/no-floating-promises": ["error", { ignoreVoid: true }],
544
+ "typescript/no-import-type-side-effects": "error",
545
+ "typescript/no-inferrable-types": "error",
546
+ "typescript/no-non-null-assertion": "error",
547
+ "typescript/no-unused-vars": ["error", { argsIgnorePattern: "^_", caughtErrors: "none" }],
548
+ "typescript/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }],
535
549
  // eslint-plugin-jest (21)
536
550
  "jest/expect-expect": "warn",
537
- "jest/no-alias-methods": "warn",
551
+ "jest/no-alias-methods": "error",
538
552
  "jest/no-commented-out-tests": "warn",
539
- "jest/no-deprecated-functions": "warn",
553
+ "jest/no-deprecated-functions": "error",
540
554
  "jest/no-disabled-tests": "warn",
541
- "jest/no-done-callback": "warn",
542
- "jest/no-export": "warn",
543
- "jest/no-focused-tests": "warn",
544
- "jest/no-identical-title": "warn",
545
- "jest/no-interpolation-in-snapshots": "warn",
546
- "jest/no-jasmine-globals": "warn",
547
- "jest/no-mocks-import": "warn",
548
- "jest/no-standalone-expect": "warn",
549
- "jest/no-test-prefixes": "warn",
550
- "jest/prefer-to-be": "warn",
551
- "jest/prefer-to-contain": "warn",
552
- "jest/prefer-to-have-length": "warn",
553
- "jest/valid-describe-callback": "warn",
554
- "jest/valid-expect": "warn",
555
- "jest/valid-expect-in-promise": "warn",
556
- "jest/valid-title": "warn",
557
- // eslint-plugin-import — aliased, oxlint reserves the name `import` (2)
558
- "import-js/no-duplicates": ["warn", { considerQueryString: true, "prefer-inline": true }],
555
+ "jest/no-done-callback": "error",
556
+ "jest/no-export": "error",
557
+ "jest/no-focused-tests": "error",
558
+ "jest/no-identical-title": "error",
559
+ "jest/no-interpolation-in-snapshots": "error",
560
+ "jest/no-jasmine-globals": "error",
561
+ "jest/no-mocks-import": "error",
562
+ "jest/no-standalone-expect": "error",
563
+ "jest/no-test-prefixes": "error",
564
+ "jest/prefer-to-be": "error",
565
+ "jest/prefer-to-contain": "error",
566
+ "jest/prefer-to-have-length": "error",
567
+ "jest/valid-describe-callback": "error",
568
+ "jest/valid-expect": "error",
569
+ "jest/valid-expect-in-promise": "error",
570
+ "jest/valid-title": "error",
571
+ // eslint-plugin-import — aliased, oxlint reserves `import` (2)
572
+ "import-js/no-duplicates": ["error", { considerQueryString: true, "prefer-inline": true }],
559
573
  "import-js/order": [
560
- "warn",
574
+ "error",
561
575
  {
562
576
  "newlines-between": "always",
563
577
  groups: ["builtin", "external", "internal", ["parent", "index"], "sibling"],
@@ -579,7 +593,7 @@ var nestLayer = {
579
593
  ],
580
594
  // @nx/eslint-plugin (1)
581
595
  "nx/enforce-module-boundaries": [
582
- "warn",
596
+ "error",
583
597
  {
584
598
  enforceBuildableLibDependency: true,
585
599
  allow: [],
@@ -886,7 +900,7 @@ var REACT_PRESET = {
886
900
  settings: IMPORT_SETTINGS,
887
901
  rules: reactRules
888
902
  };
889
- var BY_FLAVOUR2 = {
903
+ var BY_FLAVOUR3 = {
890
904
  nest: NEST_PRESET,
891
905
  react: REACT_PRESET,
892
906
  // `node` ships the base alone, deliberately. It is the honest answer for a module that
@@ -895,12 +909,12 @@ var BY_FLAVOUR2 = {
895
909
  // rules) and will grow when the tooling flavour is measured properly.
896
910
  node: BASE_PRESET
897
911
  };
898
- var LINT_FLAVOURS = Object.keys(BY_FLAVOUR2);
912
+ var LINT_FLAVOURS = Object.keys(BY_FLAVOUR3);
899
913
  function hasLintPreset(flavour) {
900
- return flavour in BY_FLAVOUR2;
914
+ return flavour in BY_FLAVOUR3;
901
915
  }
902
916
  function lintPresetFor(flavour) {
903
- return BY_FLAVOUR2[flavour] ?? BASE_PRESET;
917
+ return BY_FLAVOUR3[flavour] ?? BASE_PRESET;
904
918
  }
905
919
 
906
920
  // src/roles/lint/rename-suppressions.ts
@@ -1107,8 +1121,17 @@ function readLintAdoption(cwd) {
1107
1121
  });
1108
1122
  }
1109
1123
 
1124
+ // src/roles/lint/render-config.ts
1125
+ var DEFAULT_IGNORE_PATTERNS = [
1126
+ "**/dist/**",
1127
+ "**/node_modules/**",
1128
+ "**/coverage/**",
1129
+ "**/*.mock.ts"
1130
+ ];
1131
+
1110
1132
  // src/roles/lint/resolve-oxlint.ts
1111
1133
  import { createRequire } from "module";
1134
+ import { fileURLToPath as fileURLToPath2 } from "url";
1112
1135
  import { existsSync as existsSync5 } from "fs";
1113
1136
  import { delimiter, dirname as dirname3, join as join6 } from "path";
1114
1137
 
@@ -1159,17 +1182,22 @@ function oxlintPath(cwd, env) {
1159
1182
  function tsgolintShim(cwd) {
1160
1183
  const fromModule = resolveBin(cwd, "tsgolint");
1161
1184
  if (fromModule) return fromModule;
1185
+ const candidates = [];
1186
+ for (const owner of ["oxlint-tsgolint", "oxlint"]) {
1187
+ try {
1188
+ const packageDir = dirname3(require2.resolve(`${owner}/package.json`));
1189
+ candidates.push(join6(packageDir, "node_modules", ".bin", "tsgolint"));
1190
+ candidates.push(join6(packageDir, "..", ".bin", "tsgolint"));
1191
+ } catch {
1192
+ }
1193
+ }
1162
1194
  try {
1163
- const manifest = require2.resolve("oxlint-tsgolint/package.json");
1164
- const packageDir = dirname3(manifest);
1165
- const candidates = [
1166
- join6(packageDir, "node_modules", ".bin", "tsgolint"),
1167
- join6(packageDir, "..", ".bin", "tsgolint")
1168
- ];
1169
- return candidates.find((candidate) => existsSync5(candidate));
1195
+ const ownRoot = dirname3(require2.resolve("@hublo/sentinel/package.json"));
1196
+ candidates.push(join6(ownRoot, "node_modules", ".bin", "tsgolint"));
1170
1197
  } catch {
1171
- return void 0;
1198
+ candidates.push(resolveBin(dirname3(fileURLToPath2(import.meta.url)), "tsgolint") ?? "");
1172
1199
  }
1200
+ return candidates.find((candidate) => candidate !== "" && existsSync5(candidate));
1173
1201
  }
1174
1202
  function oxlintSearchPath(cwd) {
1175
1203
  return [`${cwd}${delimiter}node_modules/.bin (and parents)`, "sentinel's own install"].join(
@@ -1212,7 +1240,14 @@ var OxlintAdapter = class extends BaseAdapter {
1212
1240
  if (!hasLintPreset(context.flavour)) {
1213
1241
  return {
1214
1242
  operations: [],
1215
- blocked: `no lint preset for flavour "${context.flavour}" yet. Nothing was written; this module cannot adopt the lint preset until that flavour ships.`
1243
+ blocked: `no lint preset for flavour "${context.flavour}" yet (shipped: ${LINT_FLAVOURS.join(", ")}). Nothing was written; this module cannot adopt the lint preset until that flavour ships.`
1244
+ };
1245
+ }
1246
+ const current = flavourFromPreset(readLintAdoption(context.cwd).preset);
1247
+ if (current !== void 0 && current !== context.flavour) {
1248
+ return {
1249
+ operations: [],
1250
+ blocked: `this module is already adopted as "${current}", and --flavour says "${context.flavour}". Nothing was written. If the change is deliberate, delete ${LINT_CONFIG_FILE} and re-run; otherwise re-run with --flavour ${current}.`
1216
1251
  };
1217
1252
  }
1218
1253
  const disabled = disabledRulesFor(context.flavour);
@@ -1332,8 +1367,9 @@ var OxlintAdapter = class extends BaseAdapter {
1332
1367
  );
1333
1368
  }
1334
1369
  const env = { ...process.env, PATH: oxlintPath(ctx.cwd, process.env) };
1370
+ const ignores = DEFAULT_IGNORE_PATTERNS.flatMap((pattern) => ["--ignore-pattern", pattern]);
1335
1371
  const lint = (extra) => {
1336
- const result = spawnSync(oxlint, ["-c", LINT_CONFIG_FILE, ...extra, "."], {
1372
+ const result = spawnSync(oxlint, ["-c", LINT_CONFIG_FILE, ...ignores, ...extra, "."], {
1337
1373
  cwd: ctx.cwd,
1338
1374
  stdio: "inherit",
1339
1375
  env
@@ -1368,7 +1404,14 @@ var OxlintAdapter = class extends BaseAdapter {
1368
1404
  configFile: adoption.configFile,
1369
1405
  rules,
1370
1406
  typeAware: canRunTypeAware(ctx.cwd),
1371
- disabled: disabled.map((entry) => ({ rule: entry.rule, reason: entry.reason }))
1407
+ disabled: disabled.map((entry) => ({ rule: entry.rule, reason: entry.reason })),
1408
+ // Reported separately from `disabled`: these still run and still report, they just
1409
+ // cannot fail a build. Collapsing the two would hide the difference between "we do
1410
+ // not enforce this" and "we enforce this but will not block on it yet".
1411
+ downgraded: downgradedRulesFor(ctx.flavour).map((entry) => ({
1412
+ rule: entry.rule,
1413
+ reason: entry.reason
1414
+ }))
1372
1415
  };
1373
1416
  }
1374
1417
  /** How many rules the extended preset enforces, read from the preset on disk. */
@@ -1419,6 +1462,15 @@ var OxlintAdapter = class extends BaseAdapter {
1419
1462
  }
1420
1463
  /** Announce what is not enforced, so reduced coverage is never silent. */
1421
1464
  announceDisabled(flavour) {
1465
+ const softened = downgradedRulesFor(flavour);
1466
+ if (softened.length > 0) {
1467
+ process.stderr.write(
1468
+ `${palette(process.stderr).warn(
1469
+ `sentinel lint(oxlint): ${softened.length} rule(s) report but will not fail the build (${summariseByPlugin(softened)}); run --inspect --lint for each rule and why`
1470
+ )}
1471
+ `
1472
+ );
1473
+ }
1422
1474
  const disabled = disabledRulesFor(flavour);
1423
1475
  if (disabled.length === 0) return;
1424
1476
  process.stderr.write(
@@ -1859,7 +1911,7 @@ function replaceLines(current, replacements) {
1859
1911
  // src/core/apply-plan.ts
1860
1912
  import { existsSync as existsSync8, readFileSync as readFileSync7, renameSync, rmSync, writeFileSync } from "fs";
1861
1913
  import { resolve as resolve2, sep } from "path";
1862
- import { applyEdits, modify } from "jsonc-parser";
1914
+ import { applyEdits, findNodeAtLocation, modify, parseTree } from "jsonc-parser";
1863
1915
 
1864
1916
  // src/shared/deep-merge.ts
1865
1917
  function isPlainObject(value) {
@@ -1898,6 +1950,8 @@ function mergeJsonc(current, value) {
1898
1950
  function removeJsoncKeys(current, keys) {
1899
1951
  let text = current.trim().length > 0 ? current : "{}\n";
1900
1952
  for (const path of keys) {
1953
+ const root = parseTree(text);
1954
+ if (!root || !findNodeAtLocation(root, path)) continue;
1901
1955
  const edits = modify(text, path, void 0, {
1902
1956
  formattingOptions: { insertSpaces: true, tabSize: 2 }
1903
1957
  });
@@ -2059,4 +2113,4 @@ export {
2059
2113
  detectFramework,
2060
2114
  dispatch
2061
2115
  };
2062
- //# sourceMappingURL=chunk-EZCRU6XE.js.map
2116
+ //# sourceMappingURL=chunk-QPT6V2GK.js.map
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  registerAdapters,
8
8
  resolve,
9
9
  setDefaultRunner
10
- } from "./chunk-EZCRU6XE.js";
10
+ } from "./chunk-QPT6V2GK.js";
11
11
  export {
12
12
  BaseAdapter,
13
13
  all,
package/oxlint/nest.json CHANGED
@@ -29,42 +29,42 @@
29
29
  "**/*.mock.ts"
30
30
  ],
31
31
  "rules": {
32
- "typescript/ban-ts-comment": "warn",
33
- "typescript/no-array-constructor": "warn",
34
- "typescript/no-duplicate-enum-values": "warn",
35
- "typescript/no-empty-object-type": "warn",
36
- "typescript/no-extra-non-null-assertion": "warn",
37
- "typescript/no-misused-new": "warn",
38
- "typescript/no-namespace": "warn",
39
- "typescript/no-non-null-asserted-optional-chain": "warn",
40
- "typescript/no-this-alias": "warn",
41
- "typescript/no-unnecessary-type-constraint": "warn",
42
- "typescript/no-unsafe-declaration-merging": "warn",
43
- "typescript/no-unsafe-function-type": "warn",
32
+ "typescript/ban-ts-comment": "error",
33
+ "typescript/no-array-constructor": "error",
34
+ "typescript/no-duplicate-enum-values": "error",
35
+ "typescript/no-empty-object-type": "error",
36
+ "typescript/no-extra-non-null-assertion": "error",
37
+ "typescript/no-misused-new": "error",
38
+ "typescript/no-namespace": "error",
39
+ "typescript/no-non-null-asserted-optional-chain": "error",
40
+ "typescript/no-this-alias": "error",
41
+ "typescript/no-unnecessary-type-constraint": "error",
42
+ "typescript/no-unsafe-declaration-merging": "error",
43
+ "typescript/no-unsafe-function-type": "error",
44
44
  "typescript/no-unused-expressions": [
45
- "warn",
45
+ "error",
46
46
  {
47
47
  "allowShortCircuit": false,
48
48
  "allowTaggedTemplates": false,
49
49
  "allowTernary": false
50
50
  }
51
51
  ],
52
- "typescript/no-wrapper-object-types": "warn",
53
- "typescript/prefer-as-const": "warn",
54
- "typescript/prefer-namespace-keyword": "warn",
55
- "typescript/triple-slash-reference": "warn",
56
- "no-var": "warn",
52
+ "typescript/no-wrapper-object-types": "error",
53
+ "typescript/prefer-as-const": "error",
54
+ "typescript/prefer-namespace-keyword": "error",
55
+ "typescript/triple-slash-reference": "error",
56
+ "no-var": "error",
57
57
  "prefer-const": [
58
- "warn",
58
+ "error",
59
59
  {
60
60
  "destructuring": "any",
61
61
  "ignoreReadBeforeAssign": false
62
62
  }
63
63
  ],
64
- "prefer-rest-params": "warn",
65
- "prefer-spread": "warn",
64
+ "prefer-rest-params": "error",
65
+ "prefer-spread": "error",
66
66
  "array-callback-return": [
67
- "warn",
67
+ "error",
68
68
  {
69
69
  "allowImplicit": false,
70
70
  "checkForEach": false,
@@ -72,24 +72,24 @@
72
72
  }
73
73
  ],
74
74
  "complexity": [
75
- "warn",
75
+ "error",
76
76
  30
77
77
  ],
78
78
  "curly": [
79
- "warn",
79
+ "error",
80
80
  "all"
81
81
  ],
82
82
  "dot-notation": [
83
- "warn",
83
+ "error",
84
84
  {
85
85
  "allowKeywords": true,
86
86
  "allowPattern": ""
87
87
  }
88
88
  ],
89
- "eqeqeq": "warn",
90
- "for-direction": "warn",
89
+ "eqeqeq": "error",
90
+ "for-direction": "error",
91
91
  "func-style": [
92
- "warn",
92
+ "error",
93
93
  "expression",
94
94
  {
95
95
  "allowArrowFunctions": false,
@@ -97,15 +97,15 @@
97
97
  "overrides": {}
98
98
  }
99
99
  ],
100
- "no-async-promise-executor": "warn",
101
- "no-case-declarations": "warn",
102
- "no-compare-neg-zero": "warn",
100
+ "no-async-promise-executor": "error",
101
+ "no-case-declarations": "error",
102
+ "no-compare-neg-zero": "error",
103
103
  "no-cond-assign": [
104
- "warn",
104
+ "error",
105
105
  "except-parens"
106
106
  ],
107
107
  "no-console": [
108
- "warn",
108
+ "error",
109
109
  {
110
110
  "allow": [
111
111
  "warn",
@@ -113,58 +113,58 @@
113
113
  ]
114
114
  }
115
115
  ],
116
- "no-constant-binary-expression": "warn",
116
+ "no-constant-binary-expression": "error",
117
117
  "no-constant-condition": [
118
- "warn",
118
+ "error",
119
119
  {
120
120
  "checkLoops": "allExceptWhileTrue"
121
121
  }
122
122
  ],
123
- "no-debugger": "warn",
124
- "no-delete-var": "warn",
125
- "no-dupe-else-if": "warn",
126
- "no-dupe-keys": "warn",
127
- "no-duplicate-case": "warn",
123
+ "no-debugger": "error",
124
+ "no-delete-var": "error",
125
+ "no-dupe-else-if": "error",
126
+ "no-dupe-keys": "error",
127
+ "no-duplicate-case": "error",
128
128
  "no-else-return": [
129
- "warn",
129
+ "error",
130
130
  {
131
131
  "allowElseIf": true
132
132
  }
133
133
  ],
134
134
  "no-empty": [
135
- "warn",
135
+ "error",
136
136
  {
137
137
  "allowEmptyCatch": false
138
138
  }
139
139
  ],
140
- "no-empty-character-class": "warn",
140
+ "no-empty-character-class": "error",
141
141
  "no-empty-pattern": [
142
- "warn",
142
+ "error",
143
143
  {
144
144
  "allowObjectPatternsAsParameters": false
145
145
  }
146
146
  ],
147
- "no-empty-static-block": "warn",
148
- "no-ex-assign": "warn",
147
+ "no-empty-static-block": "error",
148
+ "no-ex-assign": "error",
149
149
  "no-extra-boolean-cast": [
150
- "warn",
150
+ "error",
151
151
  {}
152
152
  ],
153
153
  "no-fallthrough": [
154
- "warn",
154
+ "error",
155
155
  {
156
156
  "allowEmptyCase": false,
157
157
  "reportUnusedFallthroughComment": false
158
158
  }
159
159
  ],
160
160
  "no-global-assign": [
161
- "warn",
161
+ "error",
162
162
  {
163
163
  "exceptions": []
164
164
  }
165
165
  ],
166
166
  "no-implicit-coercion": [
167
- "warn",
167
+ "error",
168
168
  {
169
169
  "allow": [],
170
170
  "boolean": true,
@@ -174,11 +174,11 @@
174
174
  }
175
175
  ],
176
176
  "no-invalid-regexp": [
177
- "warn",
177
+ "error",
178
178
  {}
179
179
  ],
180
180
  "no-irregular-whitespace": [
181
- "warn",
181
+ "error",
182
182
  {
183
183
  "skipComments": false,
184
184
  "skipJSXText": false,
@@ -187,14 +187,14 @@
187
187
  "skipTemplates": false
188
188
  }
189
189
  ],
190
- "no-lonely-if": "warn",
191
- "no-loss-of-precision": "warn",
192
- "no-misleading-character-class": "warn",
193
- "no-nonoctal-decimal-escape": "warn",
194
- "no-prototype-builtins": "warn",
195
- "no-regex-spaces": "warn",
190
+ "no-lonely-if": "error",
191
+ "no-loss-of-precision": "error",
192
+ "no-misleading-character-class": "error",
193
+ "no-nonoctal-decimal-escape": "error",
194
+ "no-prototype-builtins": "error",
195
+ "no-regex-spaces": "error",
196
196
  "no-restricted-imports": [
197
- "warn",
197
+ "error",
198
198
  {
199
199
  "paths": [
200
200
  {
@@ -223,117 +223,117 @@
223
223
  }
224
224
  ],
225
225
  "no-self-assign": [
226
- "warn",
226
+ "error",
227
227
  {
228
228
  "props": true
229
229
  }
230
230
  ],
231
231
  "no-shadow-restricted-names": [
232
- "warn",
232
+ "error",
233
233
  {
234
234
  "reportGlobalThis": false
235
235
  }
236
236
  ],
237
- "no-sparse-arrays": "warn",
237
+ "no-sparse-arrays": "error",
238
238
  "no-unneeded-ternary": [
239
- "warn",
239
+ "error",
240
240
  {
241
241
  "defaultAssignment": true
242
242
  }
243
243
  ],
244
- "no-unsafe-finally": "warn",
244
+ "no-unsafe-finally": "error",
245
245
  "no-unsafe-optional-chaining": [
246
- "warn",
246
+ "error",
247
247
  {
248
248
  "disallowArithmeticOperators": false
249
249
  }
250
250
  ],
251
- "no-unused-labels": "warn",
252
- "no-unused-private-class-members": "warn",
253
- "no-useless-backreference": "warn",
254
- "no-useless-catch": "warn",
251
+ "no-unused-labels": "error",
252
+ "no-unused-private-class-members": "error",
253
+ "no-useless-backreference": "error",
254
+ "no-useless-catch": "error",
255
255
  "no-useless-escape": [
256
- "warn",
256
+ "error",
257
257
  {
258
258
  "allowRegexCharacters": []
259
259
  }
260
260
  ],
261
- "no-useless-return": "warn",
261
+ "no-useless-return": "error",
262
262
  "prefer-arrow-callback": [
263
- "warn",
263
+ "error",
264
264
  {
265
265
  "allowNamedFunctions": false,
266
266
  "allowUnboundThis": true
267
267
  }
268
268
  ],
269
- "require-yield": "warn",
269
+ "require-yield": "error",
270
270
  "use-isnan": [
271
- "warn",
271
+ "error",
272
272
  {
273
273
  "enforceForIndexOf": false,
274
274
  "enforceForSwitchCase": true
275
275
  }
276
276
  ],
277
277
  "valid-typeof": [
278
- "warn",
278
+ "error",
279
279
  {
280
280
  "requireStringLiterals": false
281
281
  }
282
282
  ],
283
- "typescript/await-thenable": "warn",
284
- "typescript/no-confusing-non-null-assertion": "warn",
283
+ "typescript/await-thenable": "error",
284
+ "typescript/no-confusing-non-null-assertion": "error",
285
285
  "typescript/no-empty-function": [
286
- "warn",
286
+ "error",
287
287
  {
288
288
  "allow": []
289
289
  }
290
290
  ],
291
- "typescript/no-explicit-any": "warn",
291
+ "typescript/no-explicit-any": "error",
292
292
  "typescript/no-floating-promises": [
293
- "warn",
293
+ "error",
294
294
  {
295
295
  "ignoreVoid": true
296
296
  }
297
297
  ],
298
- "typescript/no-import-type-side-effects": "warn",
299
- "typescript/no-inferrable-types": "warn",
300
- "typescript/no-non-null-assertion": "warn",
298
+ "typescript/no-import-type-side-effects": "error",
299
+ "typescript/no-inferrable-types": "error",
300
+ "typescript/no-non-null-assertion": "error",
301
301
  "typescript/no-unused-vars": [
302
- "warn",
302
+ "error",
303
303
  {
304
304
  "argsIgnorePattern": "^_",
305
305
  "caughtErrors": "none"
306
306
  }
307
307
  ],
308
308
  "typescript/switch-exhaustiveness-check": [
309
- "warn",
309
+ "error",
310
310
  {
311
311
  "considerDefaultExhaustiveForUnions": true
312
312
  }
313
313
  ],
314
314
  "jest/expect-expect": "warn",
315
- "jest/no-alias-methods": "warn",
315
+ "jest/no-alias-methods": "error",
316
316
  "jest/no-commented-out-tests": "warn",
317
- "jest/no-deprecated-functions": "warn",
317
+ "jest/no-deprecated-functions": "error",
318
318
  "jest/no-disabled-tests": "warn",
319
- "jest/no-done-callback": "warn",
320
- "jest/no-export": "warn",
321
- "jest/no-focused-tests": "warn",
322
- "jest/no-identical-title": "warn",
323
- "jest/no-interpolation-in-snapshots": "warn",
324
- "jest/no-jasmine-globals": "warn",
325
- "jest/no-mocks-import": "warn",
326
- "jest/no-standalone-expect": "warn",
327
- "jest/no-test-prefixes": "warn",
328
- "jest/prefer-to-be": "warn",
329
- "jest/prefer-to-contain": "warn",
330
- "jest/prefer-to-have-length": "warn",
331
- "jest/valid-describe-callback": "warn",
332
- "jest/valid-expect": "warn",
333
- "jest/valid-expect-in-promise": "warn",
334
- "jest/valid-title": "warn",
319
+ "jest/no-done-callback": "error",
320
+ "jest/no-export": "error",
321
+ "jest/no-focused-tests": "error",
322
+ "jest/no-identical-title": "error",
323
+ "jest/no-interpolation-in-snapshots": "error",
324
+ "jest/no-jasmine-globals": "error",
325
+ "jest/no-mocks-import": "error",
326
+ "jest/no-standalone-expect": "error",
327
+ "jest/no-test-prefixes": "error",
328
+ "jest/prefer-to-be": "error",
329
+ "jest/prefer-to-contain": "error",
330
+ "jest/prefer-to-have-length": "error",
331
+ "jest/valid-describe-callback": "error",
332
+ "jest/valid-expect": "error",
333
+ "jest/valid-expect-in-promise": "error",
334
+ "jest/valid-title": "error",
335
335
  "import-js/no-duplicates": [
336
- "warn",
336
+ "error",
337
337
  {
338
338
  "considerQueryString": true,
339
339
  "prefer-inline": true
@@ -379,7 +379,7 @@
379
379
  }
380
380
  ],
381
381
  "nx/enforce-module-boundaries": [
382
- "warn",
382
+ "error",
383
383
  {
384
384
  "enforceBuildableLibDependency": true,
385
385
  "allow": [],
@@ -393,11 +393,9 @@
393
393
  ]
394
394
  }
395
395
  ],
396
- "no-barrel-files/no-barrel-files": "off",
397
396
  "no-control-regex": "off"
398
397
  },
399
398
  "jsPlugins": [
400
- "eslint-plugin-no-barrel-files",
401
399
  {
402
400
  "name": "nx",
403
401
  "specifier": "@nx/eslint-plugin"
package/oxlint/node.json CHANGED
@@ -23,39 +23,39 @@
23
23
  "**/*.mock.ts"
24
24
  ],
25
25
  "rules": {
26
- "typescript/ban-ts-comment": "warn",
27
- "typescript/no-array-constructor": "warn",
28
- "typescript/no-duplicate-enum-values": "warn",
29
- "typescript/no-empty-object-type": "warn",
30
- "typescript/no-extra-non-null-assertion": "warn",
31
- "typescript/no-misused-new": "warn",
32
- "typescript/no-namespace": "warn",
33
- "typescript/no-non-null-asserted-optional-chain": "warn",
34
- "typescript/no-this-alias": "warn",
35
- "typescript/no-unnecessary-type-constraint": "warn",
36
- "typescript/no-unsafe-declaration-merging": "warn",
37
- "typescript/no-unsafe-function-type": "warn",
26
+ "typescript/ban-ts-comment": "error",
27
+ "typescript/no-array-constructor": "error",
28
+ "typescript/no-duplicate-enum-values": "error",
29
+ "typescript/no-empty-object-type": "error",
30
+ "typescript/no-extra-non-null-assertion": "error",
31
+ "typescript/no-misused-new": "error",
32
+ "typescript/no-namespace": "error",
33
+ "typescript/no-non-null-asserted-optional-chain": "error",
34
+ "typescript/no-this-alias": "error",
35
+ "typescript/no-unnecessary-type-constraint": "error",
36
+ "typescript/no-unsafe-declaration-merging": "error",
37
+ "typescript/no-unsafe-function-type": "error",
38
38
  "typescript/no-unused-expressions": [
39
- "warn",
39
+ "error",
40
40
  {
41
41
  "allowShortCircuit": false,
42
42
  "allowTaggedTemplates": false,
43
43
  "allowTernary": false
44
44
  }
45
45
  ],
46
- "typescript/no-wrapper-object-types": "warn",
47
- "typescript/prefer-as-const": "warn",
48
- "typescript/prefer-namespace-keyword": "warn",
49
- "typescript/triple-slash-reference": "warn",
50
- "no-var": "warn",
46
+ "typescript/no-wrapper-object-types": "error",
47
+ "typescript/prefer-as-const": "error",
48
+ "typescript/prefer-namespace-keyword": "error",
49
+ "typescript/triple-slash-reference": "error",
50
+ "no-var": "error",
51
51
  "prefer-const": [
52
- "warn",
52
+ "error",
53
53
  {
54
54
  "destructuring": "any",
55
55
  "ignoreReadBeforeAssign": false
56
56
  }
57
57
  ],
58
- "prefer-rest-params": "warn",
59
- "prefer-spread": "warn"
58
+ "prefer-rest-params": "error",
59
+ "prefer-spread": "error"
60
60
  }
61
61
  }
package/oxlint/react.json CHANGED
@@ -31,40 +31,40 @@
31
31
  "**/*.mock.ts"
32
32
  ],
33
33
  "rules": {
34
- "typescript/ban-ts-comment": "warn",
35
- "typescript/no-array-constructor": "warn",
36
- "typescript/no-duplicate-enum-values": "warn",
37
- "typescript/no-empty-object-type": "warn",
38
- "typescript/no-extra-non-null-assertion": "warn",
39
- "typescript/no-misused-new": "warn",
40
- "typescript/no-namespace": "warn",
41
- "typescript/no-non-null-asserted-optional-chain": "warn",
42
- "typescript/no-this-alias": "warn",
43
- "typescript/no-unnecessary-type-constraint": "warn",
44
- "typescript/no-unsafe-declaration-merging": "warn",
45
- "typescript/no-unsafe-function-type": "warn",
34
+ "typescript/ban-ts-comment": "error",
35
+ "typescript/no-array-constructor": "error",
36
+ "typescript/no-duplicate-enum-values": "error",
37
+ "typescript/no-empty-object-type": "error",
38
+ "typescript/no-extra-non-null-assertion": "error",
39
+ "typescript/no-misused-new": "error",
40
+ "typescript/no-namespace": "error",
41
+ "typescript/no-non-null-asserted-optional-chain": "error",
42
+ "typescript/no-this-alias": "error",
43
+ "typescript/no-unnecessary-type-constraint": "error",
44
+ "typescript/no-unsafe-declaration-merging": "error",
45
+ "typescript/no-unsafe-function-type": "error",
46
46
  "typescript/no-unused-expressions": [
47
- "warn",
47
+ "error",
48
48
  {
49
49
  "allowShortCircuit": false,
50
50
  "allowTaggedTemplates": false,
51
51
  "allowTernary": false
52
52
  }
53
53
  ],
54
- "typescript/no-wrapper-object-types": "warn",
55
- "typescript/prefer-as-const": "warn",
56
- "typescript/prefer-namespace-keyword": "warn",
57
- "typescript/triple-slash-reference": "warn",
58
- "no-var": "warn",
54
+ "typescript/no-wrapper-object-types": "error",
55
+ "typescript/prefer-as-const": "error",
56
+ "typescript/prefer-namespace-keyword": "error",
57
+ "typescript/triple-slash-reference": "error",
58
+ "no-var": "error",
59
59
  "prefer-const": [
60
- "warn",
60
+ "error",
61
61
  {
62
62
  "destructuring": "any",
63
63
  "ignoreReadBeforeAssign": false
64
64
  }
65
65
  ],
66
- "prefer-rest-params": "warn",
67
- "prefer-spread": "warn",
66
+ "prefer-rest-params": "error",
67
+ "prefer-spread": "error",
68
68
  "curly": [
69
69
  "error",
70
70
  "all"
@@ -480,13 +480,6 @@
480
480
  "jest/valid-expect": "off",
481
481
  "jest/valid-expect-in-promise": "off",
482
482
  "jest/valid-title": "off",
483
- "@tanstack/query/exhaustive-deps": "off",
484
- "@tanstack/query/infinite-query-property-order": "off",
485
- "@tanstack/query/mutation-property-order": "off",
486
- "@tanstack/query/no-rest-destructuring": "off",
487
- "@tanstack/query/no-unstable-deps": "off",
488
- "@tanstack/query/no-void-query-fn": "off",
489
- "@tanstack/query/stable-query-client": "off",
490
483
  "typescript/no-empty-function": "off",
491
484
  "typescript/no-explicit-any": "off",
492
485
  "typescript/no-unnecessary-type-assertion": "off",
@@ -502,8 +495,7 @@
502
495
  "no-console": "off",
503
496
  "no-unsafe-optional-chaining": "off",
504
497
  "react/jsx-curly-brace-presence": "off",
505
- "styled-components-a11y/label-has-for": "off",
506
- "hublo/no-palette-common": "off"
498
+ "styled-components-a11y/label-has-for": "off"
507
499
  },
508
500
  "jsPlugins": [
509
501
  "eslint-plugin-no-barrel-files",
@@ -515,10 +507,6 @@
515
507
  "name": "import-js",
516
508
  "specifier": "eslint-plugin-import"
517
509
  },
518
- {
519
- "name": "@tanstack/query",
520
- "specifier": "@tanstack/eslint-plugin-query"
521
- },
522
510
  {
523
511
  "name": "styled-components-a11y",
524
512
  "specifier": "eslint-plugin-styled-components-a11y"
@@ -526,8 +514,7 @@
526
514
  {
527
515
  "name": "react-refresh",
528
516
  "specifier": "eslint-plugin-react-refresh"
529
- },
530
- "../plugins/hublo.js"
517
+ }
531
518
  ],
532
519
  "settings": {
533
520
  "import/extensions": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.1.0-alpha.2",
3
+ "version": "1.1.0-alpha.3",
4
4
  "description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,12 @@
40
40
  "!dist/**/*.map"
41
41
  ],
42
42
  "dependencies": {
43
+ "@nx/eslint-plugin": "23.0.1",
43
44
  "commander": "^13.0.0",
45
+ "eslint-plugin-import": "2.32.0",
46
+ "eslint-plugin-no-barrel-files": "1.2.1",
47
+ "eslint-plugin-react-refresh": "0.4.19",
48
+ "eslint-plugin-styled-components-a11y": "2.2.0",
44
49
  "jsonc-parser": "^3.3.1",
45
50
  "oxlint": "1.77.0",
46
51
  "oxlint-tsgolint": "7.0.2001"