@exadev/eslint-config 1.2.0 → 1.2.1

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
@@ -95,14 +95,17 @@ This lives in its own module, separate from the main `@exadev/eslint-config` ent
95
95
  pnpm install # requires Node >=20 and pnpm 11.6.0 (pinned via packageManager)
96
96
  pnpm lint
97
97
  pnpm typecheck
98
+ pnpm test
98
99
  pnpm build
99
100
  ```
100
101
 
101
- No test suite exists for these rules currently -- each is verified by real-world usage against the repos it was extracted from, the same way it was verified before being centralized here.
102
+ Each rule has a co-located `*.test.ts` file (`src/rules/no-non-barrel-index.test.ts` etc.) exercising it with ESLint's own `RuleTester`, run under Vitest. `vitest.setup.ts` wires `RuleTester.describe`/`RuleTester.it`/`RuleTester.itOnly` to Vitest's own `describe`/`it` explicitly, rather than turning on Vitest's `test.globals` project-wide, since `RuleTester.run()` only calls `describe`/`it` if something has supplied them. Each test file constructs its own `RuleTester` with `languageOptions.parser` set to `typescript-eslint`'s parser, since these rules' realistic test fixtures use TypeScript-only syntax (e.g. `export type { X } from './y'`) that the default `espree` parser can't read; none of the four rules need type information, so no `project`/`tsconfigRootDir` is configured.
102
103
 
103
- The `lint`/`typecheck`/`build` npm scripts are thin wrappers around turbo tasks whose own names carry a leading underscore (`_lint`/`_typecheck`/`_build`, declared in `turbo.json`) -- run `pnpm build`, not `turbo run build` directly, since turbo's task names don't match the npm script names.
104
+ `pnpm test` always measures coverage (`coverage.enabled: true` in `vitest.config.ts`, via `@vitest/coverage-v8`) rather than needing a separate `--coverage` flag -- scoped to `src/**/*.ts` excluding the `*.test.ts` files themselves. The text reporter summarises in the terminal; the `html`/`lcov` reporters land in `coverage/`, already gitignored alongside `.eslintcache` and `dist/`.
104
105
 
105
- `pnpm build` runs `tsdown`, emitting ESM and CJS output plus declaration files from `src/**/*.ts` (platform-neutral, `src/**/*.test.ts` excluded). Before any publish -- local or the CI alias job -- `prepublishOnly` re-runs lint, typecheck, `tsdown`, `publint`, and `attw --pack`, so a broken export shape fails at publish time even outside the main CI pipeline.
106
+ The `lint`/`typecheck`/`test`/`build` npm scripts are thin wrappers around turbo tasks whose own names carry a leading underscore (`_lint`/`_typecheck`/`_test`/`_build`, declared in `turbo.json`) -- run `pnpm build`, not `turbo run build` directly, since turbo's task names don't match the npm script names.
107
+
108
+ `pnpm build` runs `tsdown`, emitting ESM and CJS output plus declaration files from `src/**/*.ts` (platform-neutral, `src/**/*.test.ts` excluded). Before any publish -- local or the CI alias job -- `prepublishOnly` re-runs lint, typecheck, `test`, `tsdown`, `publint`, and `attw --pack`, so a broken export shape fails at publish time even outside the main CI pipeline.
106
109
 
107
110
  ## Architecture
108
111
 
@@ -123,12 +126,12 @@ Conventional commits are enforced by commitlint, restricted to the type-enum def
123
126
  ## Gotchas and quirks
124
127
 
125
128
  - `.attw.json` ignores the `false-export-default` rule: tsdown/rolldown's CJS output for this plugin's sole default export doesn't emit the `export =` form `arethetypeswrong`'s check wants under legacy `node10` resolution. The resolution modes an ESLint flat config actually uses (`node16`, `bundler`) are unaffected, so the rule is suppressed rather than moving the plugin away from ESLint's own documented default-export shape.
126
- - Husky hooks: `pre-commit` runs lint-staged (`eslint --fix` on staged `*.ts`), `commit-msg` runs commitlint against the message, `pre-push` runs `typecheck` and `build` -- pushing here rebuilds the whole package first.
129
+ - Husky hooks: `pre-commit` runs lint-staged (`eslint --fix` on staged `*.ts`), `commit-msg` runs commitlint against the message, `pre-push` runs `typecheck`, `test`, and `build` -- pushing here re-runs the whole test suite and rebuilds the package first.
127
130
  - The CI release job sets `HUSKY=0` (so the commit-msg hook never fires against the automated release commit) and blanks `NPM_TOKEN`/`NODE_AUTH_TOKEN` explicitly rather than omitting them, so an inherited token can't win over npm's OIDC trusted-publishing exchange.
128
131
 
129
132
  ## Contributing
130
133
 
131
- Conventional commits are enforced by commitlint via a husky `commit-msg` hook, and re-checked in CI. CI runs commitlint, lint, and typecheck+build+attw on every push and pull request; the release job only runs on a push to `main`, after all three pass.
134
+ Conventional commits are enforced by commitlint via a husky `commit-msg` hook, and re-checked in CI. CI runs commitlint, lint, and typecheck+test+build+attw on every push and pull request; the release job only runs on a push to `main`, after all three pass.
132
135
 
133
136
  ## Release
134
137
 
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_plugin = require("./plugin-Dixk0WAc.cjs");
1
+ const require_plugin = require("./plugin-B_lOdZQD.cjs");
2
2
  module.exports = require_plugin.plugin;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as plugin } from "./plugin-Cq16p_yl.js";
1
+ import { t as plugin } from "./plugin-CpzdmIrK.js";
2
2
  export { plugin as default };
@@ -3,7 +3,7 @@
3
3
  const plugin = {
4
4
  meta: {
5
5
  name: "@exadev/eslint-config",
6
- version: "1.2.0",
6
+ version: "1.2.1",
7
7
  namespace: "exadev"
8
8
  },
9
9
  rules: {
@@ -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.2.0",
10
+ version: "1.2.1",
11
11
  namespace: "exadev"
12
12
  },
13
13
  rules: {
package/dist/plugin.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_plugin = require("./plugin-Dixk0WAc.cjs");
1
+ const require_plugin = require("./plugin-B_lOdZQD.cjs");
2
2
  module.exports = require_plugin.plugin;
package/dist/plugin.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as plugin } from "./plugin-Cq16p_yl.js";
1
+ import { t as plugin } from "./plugin-CpzdmIrK.js";
2
2
  export { plugin as default };
@@ -20,7 +20,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
20
  enumerable: true
21
21
  }) : target, mod));
22
22
  //#endregion
23
- const require_plugin = require("./plugin-Dixk0WAc.cjs");
23
+ const require_plugin = require("./plugin-B_lOdZQD.cjs");
24
24
  let typescript_eslint = require("typescript-eslint");
25
25
  typescript_eslint = __toESM(typescript_eslint, 1);
26
26
  //#region src/recommended-type-checked.ts
@@ -1,4 +1,4 @@
1
- import { t as plugin } from "./plugin-Cq16p_yl.js";
1
+ import { t as plugin } from "./plugin-CpzdmIrK.js";
2
2
  import tseslint from "typescript-eslint";
3
3
  //#region src/recommended-type-checked.ts
4
4
  const recommendedTypeChecked = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exadev/eslint-config",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Shared custom ESLint rules and plugin for ExaDev projects",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -62,6 +62,7 @@
62
62
  "@semantic-release/changelog": "^7.0.0",
63
63
  "@semantic-release/git": "^11.0.1",
64
64
  "@types/node": "^24.9.2",
65
+ "@vitest/coverage-v8": "^4.1.10",
65
66
  "eslint": "^10.8.0",
66
67
  "husky": "^9.1.7",
67
68
  "lint-staged": "^17.2.0",
@@ -70,7 +71,8 @@
70
71
  "tsdown": "^0.22.13",
71
72
  "turbo": "^2.10.8",
72
73
  "typescript": "^6.0.3",
73
- "typescript-eslint": "^8.65.0"
74
+ "typescript-eslint": "^8.65.0",
75
+ "vitest": "^4.1.10"
74
76
  },
75
77
  "scripts": {
76
78
  "build": "turbo run _build",
@@ -79,7 +81,9 @@
79
81
  "_lint": "eslint . --fix --cache --max-warnings 0",
80
82
  "typecheck": "turbo run _typecheck",
81
83
  "_typecheck": "tsc -p tsconfig.json",
82
- "prepublishOnly": "pnpm run lint && pnpm run typecheck && tsdown && publint && attw --pack",
84
+ "test": "turbo run _test",
85
+ "_test": "vitest run",
86
+ "prepublishOnly": "pnpm run lint && pnpm run typecheck && pnpm run test && tsdown && publint && attw --pack",
83
87
  "prepare": "husky",
84
88
  "release": "semantic-release"
85
89
  }