@exadev/eslint-config 1.0.0 → 1.1.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
@@ -1,12 +1,12 @@
1
1
  # @exadev/eslint-config
2
2
 
3
- > A real ESLint plugin (not a shareable config) exposing custom rules shared across ExaDev projects, starting with the [documents.js](https://github.com/ExaDev/documents.js) family (`documents.js`, `ooxml.js`, `odf.js`, `document-schema.js`, `pdf-codec`, `markdown-codec`). Also published under the unscoped alias `exadev-eslint-config`.
3
+ > A real ESLint plugin (not a shareable config) exposing custom rules shared across ExaDev projects. Also published under the unscoped alias `exadev-eslint-config`.
4
4
 
5
5
  ## Why
6
6
 
7
- Every one of those repos independently carried identical copies of a handful of custom ESLint rules (barrel/index discipline, re-export placement, pointless-alias detection). Keeping them as per-repo copies meant a bug fix in one rule had to be found, fixed, and re-verified separately in every repo it was copied into. This package is the single source of truth for those rules instead.
7
+ Multiple ExaDev repos independently carried identical copies of a handful of custom ESLint rules (barrel/index discipline, re-export placement, pointless-alias detection). Keeping them as per-repo copies meant a bug fix in one rule had to be found, fixed, and re-verified separately in every repo it was copied into. This package is the single source of truth for those rules instead.
8
8
 
9
- Only the *rules* are centralized here, not each consumer's whole `eslint.config.ts`. Every repo's own file-scoping (`files`/`ignores`), tsconfig wiring, and Worker-isomorphism import bans genuinely differ from repo to repo -- forcing those into one shared config would mean either losing real per-repo distinctions or building a heavily-parameterised config just to route around them. Each consumer keeps its own `eslint.config.ts`, importing rule implementations from here instead of a local copy.
9
+ Only the *rules* are centralized here, not a consumer's whole `eslint.config.ts`. A repo's own file-scoping (`files`/`ignores`), tsconfig wiring, and any runtime-isomorphism import bans are genuinely project-specific -- forcing those into one shared config would mean either losing real per-project distinctions or building a heavily-parameterised config just to route around them. Each consumer keeps its own `eslint.config.ts`, importing rule implementations from here instead of a local copy.
10
10
 
11
11
  ## Usage
12
12
 
@@ -42,12 +42,14 @@ export default defineConfig([
42
42
  {
43
43
  files: ['**/*.ts'],
44
44
  plugins: { exadev },
45
- extends: ['exadev/recommended'], // every rule this plugin defines
45
+ extends: ['exadev/recommended'], // every rule this plugin defines, plus no-inline-config and no-type-assertions
46
46
  // or: extends: ['exadev/barrel'], // just the barrel-discipline trio (no-non-barrel-index, no-non-barrel-reexport, no-side-effects-in-index)
47
47
  },
48
48
  ]);
49
49
  ```
50
50
 
51
+ `recommended` also turns on two general code-quality settings every current consumer already wires independently: `linterOptions.noInlineConfig` (no `eslint-disable` comments anywhere -- an exception belongs in the config, scoped to where it applies, not hidden inline in the source it's disabling a rule for) and `@typescript-eslint/consistent-type-assertions` set to `never` (no `as`/angle-bracket type assertions -- narrow with a guard or parse with Zod instead). The type-assertions rule is `@typescript-eslint`'s own, not one this plugin defines, so `recommended` assumes the consumer already has `typescript-eslint` registered under the `@typescript-eslint` namespace -- true for every consumer this plugin currently has. A consumer with no typescript-eslint at all should use `barrel`, or wire the four `exadev/*` rules directly, instead of taking `recommended` wholesale.
52
+
51
53
  ## Rules
52
54
 
53
55
  | Rule | Fixable | Description |
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  const plugin = {
4
4
  meta: {
5
5
  name: "@exadev/eslint-config",
6
- version: "1.0.0",
6
+ version: "1.1.0",
7
7
  namespace: "exadev"
8
8
  },
9
9
  rules: {
@@ -19,11 +19,13 @@ if (configs === void 0) throw new Error("Unreachable: configs was just initializ
19
19
  Object.assign(configs, {
20
20
  recommended: {
21
21
  plugins: { exadev: plugin },
22
+ linterOptions: { noInlineConfig: true },
22
23
  rules: {
23
24
  "exadev/no-non-barrel-index": "error",
24
25
  "exadev/no-non-barrel-reexport": "error",
25
26
  "exadev/no-pointless-reassignment": "error",
26
- "exadev/no-side-effects-in-index": "error"
27
+ "exadev/no-side-effects-in-index": "error",
28
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }]
27
29
  }
28
30
  },
29
31
  barrel: {
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import noSideEffectsInIndex from "./rules/no-side-effects-in-index.js";
7
7
  const plugin = {
8
8
  meta: {
9
9
  name: "@exadev/eslint-config",
10
- version: "1.0.0",
10
+ version: "1.1.0",
11
11
  namespace: "exadev"
12
12
  },
13
13
  rules: {
@@ -23,11 +23,13 @@ if (configs === void 0) throw new Error("Unreachable: configs was just initializ
23
23
  Object.assign(configs, {
24
24
  recommended: {
25
25
  plugins: { exadev: plugin },
26
+ linterOptions: { noInlineConfig: true },
26
27
  rules: {
27
28
  "exadev/no-non-barrel-index": "error",
28
29
  "exadev/no-non-barrel-reexport": "error",
29
30
  "exadev/no-pointless-reassignment": "error",
30
- "exadev/no-side-effects-in-index": "error"
31
+ "exadev/no-side-effects-in-index": "error",
32
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }]
31
33
  }
32
34
  },
33
35
  barrel: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exadev/eslint-config",
3
- "version": "1.0.0",
4
- "description": "Shared custom ESLint rules for ExaDev projects, starting with the documents.js family",
3
+ "version": "1.1.0",
4
+ "description": "Shared custom ESLint rules and plugin for ExaDev projects",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "license": "MIT",