@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 +8 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{plugin-Dixk0WAc.cjs → plugin-B_lOdZQD.cjs} +1 -1
- package/dist/{plugin-Cq16p_yl.js → plugin-CpzdmIrK.js} +1 -1
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +1 -1
- package/dist/recommended-type-checked.cjs +1 -1
- package/dist/recommended-type-checked.js +1 -1
- package/package.json +7 -3
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
|
-
|
|
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
|
-
|
|
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
|
-
`
|
|
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
|
|
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-
|
|
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-
|
|
1
|
+
import { t as plugin } from "./plugin-CpzdmIrK.js";
|
|
2
2
|
export { plugin as default };
|
package/dist/plugin.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_plugin = require("./plugin-
|
|
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-
|
|
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-
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exadev/eslint-config",
|
|
3
|
-
"version": "1.2.
|
|
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
|
-
"
|
|
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
|
}
|