exadev-eslint-config 2.7.0 → 2.9.0

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
@@ -16,7 +16,7 @@ Consumers need `eslint >=10.0.0` and `typescript-eslint >=8.0.0` as required pee
16
16
  pnpm add -D @exadev/eslint-config typescript-eslint eslint
17
17
  ```
18
18
 
19
- The default export is the full, type-checked ruleset: typescript-eslint's `strictTypeChecked` + `stylisticTypeChecked` presets (`strictTypeChecked` subsumes `recommendedTypeChecked`, so it already includes `no-deprecated`, `no-misused-spread`, `no-mixed-enums`, `no-unnecessary-condition`, `use-unknown-in-catch-callback-variable`, `return-await`, `related-getter-setter-pairs`, `no-unnecessary-type-parameters`, and more -- those are no longer re-listed below), `exadev/barrel-policy` at `mode: 'banned'` (see [Barrel policy](#barrel-policy)), `exadev/no-object-assign`, `exadev/no-mutable-union-array-param`, `exadev/no-array-isarray-mutation`, `exadev/no-enum-number-widening`, `exadev/no-enum-reverse-lookup-widening`, `exadev/no-map-instanceof-mutation`, `exadev/no-set-instanceof-mutation`, `exadev/prefer-readonly-array-param`, `exadev/prefer-readonly-object-param`, `exadev/prefer-numeric-sort-compare`, `exadev/no-pointless-reassignment`, `linterOptions.noInlineConfig`, `@typescript-eslint/consistent-type-assertions` banning all type assertions, `@typescript-eslint/consistent-type-imports`, `@typescript-eslint/consistent-type-exports`, `@typescript-eslint/no-non-null-assertion` banning the `!` operator (the same manual-override escape hatch as a type assertion, under a different spelling), `@typescript-eslint/ban-ts-comment` banning `@ts-expect-error` outright, `@typescript-eslint/method-signature-style` set to `'property'` (method-shorthand signatures are checked bivariantly under `strictFunctionTypes`, which is unsound), `@typescript-eslint/prefer-readonly`, `@typescript-eslint/promise-function-async`, `@typescript-eslint/require-array-sort-compare`, `@typescript-eslint/switch-exhaustiveness-check`, `@typescript-eslint/strict-boolean-expressions` at the rule's own bare defaults (an unambiguous non-nullable truthy check stays allowed; an ambiguous nullable check does not), and `@typescript-eslint/no-magic-numbers` tuned to exempt array indexes, enum members, readonly class properties, default parameter values, and the handful of universally-idiomatic bare numbers (`-1`, `0`, `1`, `2`) -- the type-assertion and ts-comment rules are relaxed in test files, and `no-magic-numbers` is not (see below). Spread it directly into `tseslint.config(...)`:
19
+ The default export is the full, type-checked ruleset: typescript-eslint's `strictTypeChecked` + `stylisticTypeChecked` presets (`strictTypeChecked` subsumes `recommendedTypeChecked`, so it already includes `no-deprecated`, `no-misused-spread`, `no-mixed-enums`, `no-unnecessary-condition`, `use-unknown-in-catch-callback-variable`, `return-await`, `related-getter-setter-pairs`, `no-unnecessary-type-parameters`, and more -- those are no longer re-listed below), `exadev/barrel-policy` at `mode: 'banned'` (see [Barrel policy](#barrel-policy)), `exadev/no-object-assign`, `exadev/no-mutable-union-array-param`, `exadev/no-array-isarray-mutation`, `exadev/no-enum-number-widening`, `exadev/no-enum-reverse-lookup-widening`, `exadev/no-map-instanceof-mutation`, `exadev/no-set-instanceof-mutation`, `exadev/prefer-readonly-array-param`, `exadev/prefer-readonly-object-param`, `exadev/prefer-numeric-sort-compare`, `exadev/no-pointless-reassignment`, `linterOptions.noInlineConfig`, `@typescript-eslint/consistent-type-assertions` banning all type assertions, `@typescript-eslint/consistent-type-imports`, `@typescript-eslint/consistent-type-exports`, `@typescript-eslint/consistent-return` (a function that implicitly returns `undefined` on one path and a real value on another -- a common real bug, not a deliberate design), `@typescript-eslint/no-non-null-assertion` banning the `!` operator (the same manual-override escape hatch as a type assertion, under a different spelling), `@typescript-eslint/no-redeclare`, `@typescript-eslint/no-shadow`, `@typescript-eslint/no-use-before-define` set to `{ functions: false }` (a genuine temporal-dead-zone crash risk for `let`/`const`/`class`/enum bindings, but exempting function declarations, which are fully hoisted and therefore runtime-safe to call before their point of textual declaration -- this codebase's own rule files consistently define their helper functions after the logic that calls them), `@typescript-eslint/ban-ts-comment` banning `@ts-expect-error` outright, `@typescript-eslint/method-signature-style` set to `'property'` (method-shorthand signatures are checked bivariantly under `strictFunctionTypes`, which is unsound), `@typescript-eslint/prefer-readonly`, `@typescript-eslint/promise-function-async`, `@typescript-eslint/require-array-sort-compare`, `@typescript-eslint/strict-void-return` (not yet in any typescript-eslint preset -- disallows passing a value-returning function where a void-returning one is expected, e.g. `arr.forEach(x => otherArray.push(x))`, which typechecks today under TS's own void-return contravariance leniency), `@typescript-eslint/switch-exhaustiveness-check`, `@typescript-eslint/strict-boolean-expressions` at the rule's own bare defaults (an unambiguous non-nullable truthy check stays allowed; an ambiguous nullable check does not), and `@typescript-eslint/no-magic-numbers` tuned to exempt array indexes, enum members, readonly class properties, default parameter values, and the handful of universally-idiomatic bare numbers (`-1`, `0`, `1`, `2`) -- the type-assertion and ts-comment rules are relaxed in test files, and `no-magic-numbers` is not (see below). Spread it directly into `tseslint.config(...)`:
20
20
 
21
21
  ```ts
22
22
  // eslint.config.ts
package/dist/index.cjs CHANGED
@@ -32,7 +32,7 @@ let typescript = require("typescript");
32
32
  typescript = __toESM(typescript, 1);
33
33
  let ts_api_utils = require("ts-api-utils");
34
34
  //#region package.json
35
- var version = "2.7.0";
35
+ var version = "2.9.0";
36
36
  //#endregion
37
37
  //#region src/rules/barrel-helpers.ts
38
38
  const INDEX_BASENAME$1 = /^index\.[cm]?[tj]sx?$/;
@@ -1274,6 +1274,7 @@ const recommendedTypeChecked = [
1274
1274
  "exadev/prefer-readonly-array-param": "error",
1275
1275
  "exadev/prefer-readonly-object-param": "error",
1276
1276
  "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": true }],
1277
+ "@typescript-eslint/consistent-return": "error",
1277
1278
  "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
1278
1279
  "@typescript-eslint/consistent-type-exports": "error",
1279
1280
  "@typescript-eslint/consistent-type-imports": "error",
@@ -1291,10 +1292,14 @@ const recommendedTypeChecked = [
1291
1292
  ignoreDefaultValues: true
1292
1293
  }],
1293
1294
  "@typescript-eslint/no-non-null-assertion": "error",
1295
+ "@typescript-eslint/no-redeclare": "error",
1296
+ "@typescript-eslint/no-shadow": "error",
1297
+ "@typescript-eslint/no-use-before-define": ["error", { functions: false }],
1294
1298
  "@typescript-eslint/prefer-readonly": "error",
1295
1299
  "@typescript-eslint/promise-function-async": "error",
1296
1300
  "@typescript-eslint/require-array-sort-compare": "error",
1297
1301
  "@typescript-eslint/strict-boolean-expressions": "error",
1302
+ "@typescript-eslint/strict-void-return": "error",
1298
1303
  "@typescript-eslint/switch-exhaustiveness-check": "error"
1299
1304
  }
1300
1305
  },
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { AST_NODE_TYPES, ESLintUtils, TSESLint } from "@typescript-eslint/utils"
4
4
  import * as ts from "typescript";
5
5
  import { isPropertyReadonlyInType, isTypeReference } from "ts-api-utils";
6
6
  //#region package.json
7
- var version = "2.7.0";
7
+ var version = "2.9.0";
8
8
  //#endregion
9
9
  //#region src/rules/barrel-helpers.ts
10
10
  const INDEX_BASENAME$1 = /^index\.[cm]?[tj]sx?$/;
@@ -1246,6 +1246,7 @@ const recommendedTypeChecked = [
1246
1246
  "exadev/prefer-readonly-array-param": "error",
1247
1247
  "exadev/prefer-readonly-object-param": "error",
1248
1248
  "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": true }],
1249
+ "@typescript-eslint/consistent-return": "error",
1249
1250
  "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
1250
1251
  "@typescript-eslint/consistent-type-exports": "error",
1251
1252
  "@typescript-eslint/consistent-type-imports": "error",
@@ -1263,10 +1264,14 @@ const recommendedTypeChecked = [
1263
1264
  ignoreDefaultValues: true
1264
1265
  }],
1265
1266
  "@typescript-eslint/no-non-null-assertion": "error",
1267
+ "@typescript-eslint/no-redeclare": "error",
1268
+ "@typescript-eslint/no-shadow": "error",
1269
+ "@typescript-eslint/no-use-before-define": ["error", { functions: false }],
1266
1270
  "@typescript-eslint/prefer-readonly": "error",
1267
1271
  "@typescript-eslint/promise-function-async": "error",
1268
1272
  "@typescript-eslint/require-array-sort-compare": "error",
1269
1273
  "@typescript-eslint/strict-boolean-expressions": "error",
1274
+ "@typescript-eslint/strict-void-return": "error",
1270
1275
  "@typescript-eslint/switch-exhaustiveness-check": "error"
1271
1276
  }
1272
1277
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exadev-eslint-config",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Shared custom ESLint rules and plugin for ExaDev projects",
5
5
  "type": "module",
6
6
  "sideEffects": false,