@exadev/eslint-config 1.1.2 → 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 +40 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-B_lOdZQD.cjs +46 -0
- package/dist/plugin-CpzdmIrK.js +45 -0
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +1 -1
- package/dist/recommended-type-checked.cjs +43 -0
- package/dist/recommended-type-checked.d.cts +5 -0
- package/dist/recommended-type-checked.d.ts +6 -0
- package/dist/recommended-type-checked.js +20 -0
- package/package.json +14 -4
- package/dist/plugin-DeBcMjPX.cjs +0 -46
- package/dist/plugin-UsvTGA6w.js +0 -45
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Only the *rules* are centralized here, not a consumer's whole `eslint.config.ts`
|
|
|
12
12
|
|
|
13
13
|
## Getting started
|
|
14
14
|
|
|
15
|
-
Consumers need `eslint >=10.0.0` as a peer dependency.
|
|
15
|
+
Consumers need `eslint >=10.0.0` as a peer dependency. `typescript-eslint >=8.0.0` is also a peer dependency, but an *optional* one (`peerDependenciesMeta`) -- it's only needed by the `recommended-type-checked` entry point described below, not by the package as a whole. A plain-JS project with no TypeScript at all can install and use this package with nothing else added.
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
18
|
pnpm add -D @exadev/eslint-config
|
|
@@ -46,13 +46,39 @@ export default defineConfig([
|
|
|
46
46
|
{
|
|
47
47
|
files: ['**/*.ts'],
|
|
48
48
|
plugins: { exadev },
|
|
49
|
-
extends: ['exadev/recommended'], //
|
|
49
|
+
extends: ['exadev/recommended'], // this plugin's own four rules, plus linterOptions.noInlineConfig -- no TypeScript involvement at all
|
|
50
50
|
// or: extends: ['exadev/barrel'], // just the barrel-discipline trio (no-non-barrel-index, no-non-barrel-reexport, no-side-effects-in-index)
|
|
51
51
|
},
|
|
52
52
|
]);
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
`recommended`
|
|
55
|
+
Both `recommended` and `barrel` are usable in a plain JavaScript project with no TypeScript and no `typescript-eslint` installed: this plugin's own four rules operate on plain ESTree import/export/declaration nodes, nothing TypeScript-specific, and neither config references `typescript-eslint` at all.
|
|
56
|
+
|
|
57
|
+
### The typed-linting bundle: `@exadev/eslint-config/recommended-type-checked`
|
|
58
|
+
|
|
59
|
+
For a TypeScript project that wants the full typed-linting baseline bundled in, import the separate `recommended-type-checked` entry point instead of using `configs.recommended`:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// eslint.config.ts
|
|
63
|
+
import exadevRecommendedTypeChecked from '@exadev/eslint-config/recommended-type-checked';
|
|
64
|
+
import tseslint from 'typescript-eslint';
|
|
65
|
+
|
|
66
|
+
export default tseslint.config(
|
|
67
|
+
{
|
|
68
|
+
languageOptions: {
|
|
69
|
+
parserOptions: { project: './tsconfig.json', tsconfigRootDir: import.meta.dirname },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
...exadevRecommendedTypeChecked,
|
|
73
|
+
// ...your own config on top...
|
|
74
|
+
);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This bundles `typescript-eslint`'s own `recommendedTypeChecked` and `stylisticTypeChecked` presets (`recommendedTypeChecked` already subsumes plain `recommended` outright -- every one of its 46 rules is a strict subset of `recommendedTypeChecked`'s 73, confirmed by inspecting the actual rule maps) alongside this plugin's own four rules, `linterOptions.noInlineConfig`, and `@typescript-eslint/consistent-type-assertions` set to `never` (no `as`/angle-bracket type assertions -- narrow with a guard or parse with Zod instead).
|
|
78
|
+
|
|
79
|
+
It's a real bundling, not a rule reference that assumes the consumer already has `typescript-eslint` set up: `recommendedTypeChecked`'s own base config registers the `@typescript-eslint` plugin and sets `languageOptions.parser` itself. **A consumer adopting this bundle must remove its own `...tseslint.configs.recommended`/`recommendedTypeChecked`/`stylisticTypeChecked` spreads** rather than keep them alongside it -- ESLint flat config rejects two different plugin object instances registered under the same namespace. What a consumer still supplies itself is `languageOptions.parserOptions.project`/`projectService` pointing at its own tsconfig(s); `recommendedTypeChecked`'s base config never sets that, since it's genuinely project-specific.
|
|
80
|
+
|
|
81
|
+
This lives in its own module, separate from the main `@exadev/eslint-config` entry point, specifically so importing the main package never attempts to resolve `typescript-eslint`. A plain object property (or a lazy getter) on the base plugin's own `configs` map can't achieve that: ESLint's `extends` resolution is synchronous, so a dynamic `import()` doesn't help either -- it just hides the same requirement behind an unawaited promise. Splitting into a genuinely separate module sidesteps the problem at the right layer: Node's own module resolution only loads a module when something actually imports it.
|
|
56
82
|
|
|
57
83
|
## Rules
|
|
58
84
|
|
|
@@ -69,18 +95,23 @@ export default defineConfig([
|
|
|
69
95
|
pnpm install # requires Node >=20 and pnpm 11.6.0 (pinned via packageManager)
|
|
70
96
|
pnpm lint
|
|
71
97
|
pnpm typecheck
|
|
98
|
+
pnpm test
|
|
72
99
|
pnpm build
|
|
73
100
|
```
|
|
74
101
|
|
|
75
|
-
|
|
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.
|
|
76
103
|
|
|
77
|
-
|
|
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/`.
|
|
78
105
|
|
|
79
|
-
`
|
|
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.
|
|
80
109
|
|
|
81
110
|
## Architecture
|
|
82
111
|
|
|
83
|
-
`src/plugin.ts` builds an `ESLint.Plugin` object (ESLint's own `ESLint.Plugin` type, not a hand-written interface) combining the four rule modules under `src/rules/` into a flat `rules` map.
|
|
112
|
+
`src/plugin.ts` builds an `ESLint.Plugin` object (ESLint's own `ESLint.Plugin` type, not a hand-written interface) combining the four rule modules under `src/rules/` into a flat `rules` map. `configs.recommended` and `configs.barrel` are defined as getters directly in the object literal, not attached after construction: each needs to reference the fully-built `plugin` object itself (`plugins: { exadev: plugin }`), which a plain property initializer can't do for its own binding while it's still being constructed. A getter closes over the `plugin` binding rather than its value, so it resolves correctly the moment a consumer actually reads the property, by which point construction has finished -- no `Object.assign`, no post-construction mutation, no null-checked destructure needed. `src/index.ts` is the public entry point and is nothing but `export { default } from './plugin';` -- a genuine pure re-export barrel.
|
|
113
|
+
|
|
114
|
+
`src/recommended-type-checked.ts` is a deliberately separate module, not a third property on the base plugin's own `configs`. It imports `typescript-eslint` to bundle `recommendedTypeChecked` + `stylisticTypeChecked` alongside this plugin's own rules -- see [The typed-linting bundle](#the-typed-linting-bundle-exadeveslint-configrecommended-type-checked) above for why that has to live in its own module rather than on the shared plugin object: importing the main entry point must never attempt to resolve `typescript-eslint`, and Node's own module resolution only loads a module when something actually imports it.
|
|
84
115
|
|
|
85
116
|
`pnpm-workspace.yaml` deliberately declares an empty `packages: []`. This is not a real multi-package pnpm workspace; its only purpose is giving turbo a workspace root to anchor local task caching against, matching the same single-package-workspace pattern used across this repo family.
|
|
86
117
|
|
|
@@ -95,12 +126,12 @@ Conventional commits are enforced by commitlint, restricted to the type-enum def
|
|
|
95
126
|
## Gotchas and quirks
|
|
96
127
|
|
|
97
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.
|
|
98
|
-
- 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.
|
|
99
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.
|
|
100
131
|
|
|
101
132
|
## Contributing
|
|
102
133
|
|
|
103
|
-
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.
|
|
104
135
|
|
|
105
136
|
## Release
|
|
106
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 };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#endregion
|
|
2
|
+
//#region src/plugin.ts
|
|
3
|
+
const plugin = {
|
|
4
|
+
meta: {
|
|
5
|
+
name: "@exadev/eslint-config",
|
|
6
|
+
version: "1.2.1",
|
|
7
|
+
namespace: "exadev"
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
"no-non-barrel-index": require("./rules/no-non-barrel-index.cjs"),
|
|
11
|
+
"no-non-barrel-reexport": require("./rules/no-non-barrel-reexport.cjs"),
|
|
12
|
+
"no-pointless-reassignment": require("./rules/no-pointless-reassignment.cjs"),
|
|
13
|
+
"no-side-effects-in-index": require("./rules/no-side-effects-in-index.cjs")
|
|
14
|
+
},
|
|
15
|
+
configs: {
|
|
16
|
+
get recommended() {
|
|
17
|
+
return {
|
|
18
|
+
plugins: { exadev: plugin },
|
|
19
|
+
linterOptions: { noInlineConfig: true },
|
|
20
|
+
rules: {
|
|
21
|
+
"exadev/no-non-barrel-index": "error",
|
|
22
|
+
"exadev/no-non-barrel-reexport": "error",
|
|
23
|
+
"exadev/no-pointless-reassignment": "error",
|
|
24
|
+
"exadev/no-side-effects-in-index": "error"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
get barrel() {
|
|
29
|
+
return {
|
|
30
|
+
plugins: { exadev: plugin },
|
|
31
|
+
rules: {
|
|
32
|
+
"exadev/no-non-barrel-index": "error",
|
|
33
|
+
"exadev/no-non-barrel-reexport": "error",
|
|
34
|
+
"exadev/no-side-effects-in-index": "error"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
Object.defineProperty(exports, "plugin", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function() {
|
|
44
|
+
return plugin;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import noNonBarrelIndex from "./rules/no-non-barrel-index.js";
|
|
2
|
+
import noNonBarrelReexport from "./rules/no-non-barrel-reexport.js";
|
|
3
|
+
import noPointlessReassignment from "./rules/no-pointless-reassignment.js";
|
|
4
|
+
import noSideEffectsInIndex from "./rules/no-side-effects-in-index.js";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/plugin.ts
|
|
7
|
+
const plugin = {
|
|
8
|
+
meta: {
|
|
9
|
+
name: "@exadev/eslint-config",
|
|
10
|
+
version: "1.2.1",
|
|
11
|
+
namespace: "exadev"
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"no-non-barrel-index": noNonBarrelIndex,
|
|
15
|
+
"no-non-barrel-reexport": noNonBarrelReexport,
|
|
16
|
+
"no-pointless-reassignment": noPointlessReassignment,
|
|
17
|
+
"no-side-effects-in-index": noSideEffectsInIndex
|
|
18
|
+
},
|
|
19
|
+
configs: {
|
|
20
|
+
get recommended() {
|
|
21
|
+
return {
|
|
22
|
+
plugins: { exadev: plugin },
|
|
23
|
+
linterOptions: { noInlineConfig: true },
|
|
24
|
+
rules: {
|
|
25
|
+
"exadev/no-non-barrel-index": "error",
|
|
26
|
+
"exadev/no-non-barrel-reexport": "error",
|
|
27
|
+
"exadev/no-pointless-reassignment": "error",
|
|
28
|
+
"exadev/no-side-effects-in-index": "error"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
get barrel() {
|
|
33
|
+
return {
|
|
34
|
+
plugins: { exadev: plugin },
|
|
35
|
+
rules: {
|
|
36
|
+
"exadev/no-non-barrel-index": "error",
|
|
37
|
+
"exadev/no-non-barrel-reexport": "error",
|
|
38
|
+
"exadev/no-side-effects-in-index": "error"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { plugin as t };
|
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 };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
const require_plugin = require("./plugin-B_lOdZQD.cjs");
|
|
24
|
+
let typescript_eslint = require("typescript-eslint");
|
|
25
|
+
typescript_eslint = __toESM(typescript_eslint, 1);
|
|
26
|
+
//#region src/recommended-type-checked.ts
|
|
27
|
+
const recommendedTypeChecked = [
|
|
28
|
+
...typescript_eslint.default.configs.recommendedTypeChecked,
|
|
29
|
+
...typescript_eslint.default.configs.stylisticTypeChecked,
|
|
30
|
+
{
|
|
31
|
+
plugins: { exadev: require_plugin.plugin },
|
|
32
|
+
linterOptions: { noInlineConfig: true },
|
|
33
|
+
rules: {
|
|
34
|
+
"exadev/no-non-barrel-index": "error",
|
|
35
|
+
"exadev/no-non-barrel-reexport": "error",
|
|
36
|
+
"exadev/no-pointless-reassignment": "error",
|
|
37
|
+
"exadev/no-side-effects-in-index": "error",
|
|
38
|
+
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
//#endregion
|
|
43
|
+
module.exports = recommendedTypeChecked;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as plugin } from "./plugin-CpzdmIrK.js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
//#region src/recommended-type-checked.ts
|
|
4
|
+
const recommendedTypeChecked = [
|
|
5
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
6
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
7
|
+
{
|
|
8
|
+
plugins: { exadev: plugin },
|
|
9
|
+
linterOptions: { noInlineConfig: true },
|
|
10
|
+
rules: {
|
|
11
|
+
"exadev/no-non-barrel-index": "error",
|
|
12
|
+
"exadev/no-non-barrel-reexport": "error",
|
|
13
|
+
"exadev/no-pointless-reassignment": "error",
|
|
14
|
+
"exadev/no-side-effects-in-index": "error",
|
|
15
|
+
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
//#endregion
|
|
20
|
+
export { recommendedTypeChecked as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exadev/eslint-config",
|
|
3
|
-
"version": "1.1
|
|
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,
|
|
@@ -46,7 +46,13 @@
|
|
|
46
46
|
"url": "git+https://github.com/ExaDev/eslint-config.git"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"eslint": ">=10.0.0"
|
|
49
|
+
"eslint": ">=10.0.0",
|
|
50
|
+
"typescript-eslint": ">=8.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"typescript-eslint": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
50
56
|
},
|
|
51
57
|
"devDependencies": {
|
|
52
58
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -56,6 +62,7 @@
|
|
|
56
62
|
"@semantic-release/changelog": "^7.0.0",
|
|
57
63
|
"@semantic-release/git": "^11.0.1",
|
|
58
64
|
"@types/node": "^24.9.2",
|
|
65
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
59
66
|
"eslint": "^10.8.0",
|
|
60
67
|
"husky": "^9.1.7",
|
|
61
68
|
"lint-staged": "^17.2.0",
|
|
@@ -64,7 +71,8 @@
|
|
|
64
71
|
"tsdown": "^0.22.13",
|
|
65
72
|
"turbo": "^2.10.8",
|
|
66
73
|
"typescript": "^6.0.3",
|
|
67
|
-
"typescript-eslint": "^8.65.0"
|
|
74
|
+
"typescript-eslint": "^8.65.0",
|
|
75
|
+
"vitest": "^4.1.10"
|
|
68
76
|
},
|
|
69
77
|
"scripts": {
|
|
70
78
|
"build": "turbo run _build",
|
|
@@ -73,7 +81,9 @@
|
|
|
73
81
|
"_lint": "eslint . --fix --cache --max-warnings 0",
|
|
74
82
|
"typecheck": "turbo run _typecheck",
|
|
75
83
|
"_typecheck": "tsc -p tsconfig.json",
|
|
76
|
-
"
|
|
84
|
+
"test": "turbo run _test",
|
|
85
|
+
"_test": "vitest run",
|
|
86
|
+
"prepublishOnly": "pnpm run lint && pnpm run typecheck && pnpm run test && tsdown && publint && attw --pack",
|
|
77
87
|
"prepare": "husky",
|
|
78
88
|
"release": "semantic-release"
|
|
79
89
|
}
|
package/dist/plugin-DeBcMjPX.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//#endregion
|
|
2
|
-
//#region src/plugin.ts
|
|
3
|
-
const plugin = {
|
|
4
|
-
meta: {
|
|
5
|
-
name: "@exadev/eslint-config",
|
|
6
|
-
version: "1.1.2",
|
|
7
|
-
namespace: "exadev"
|
|
8
|
-
},
|
|
9
|
-
rules: {
|
|
10
|
-
"no-non-barrel-index": require("./rules/no-non-barrel-index.cjs"),
|
|
11
|
-
"no-non-barrel-reexport": require("./rules/no-non-barrel-reexport.cjs"),
|
|
12
|
-
"no-pointless-reassignment": require("./rules/no-pointless-reassignment.cjs"),
|
|
13
|
-
"no-side-effects-in-index": require("./rules/no-side-effects-in-index.cjs")
|
|
14
|
-
},
|
|
15
|
-
configs: {}
|
|
16
|
-
};
|
|
17
|
-
const { configs } = plugin;
|
|
18
|
-
if (configs === void 0) throw new Error("Unreachable: configs was just initialized to {} in the object literal above.");
|
|
19
|
-
Object.assign(configs, {
|
|
20
|
-
recommended: {
|
|
21
|
-
plugins: { exadev: plugin },
|
|
22
|
-
linterOptions: { noInlineConfig: true },
|
|
23
|
-
rules: {
|
|
24
|
-
"exadev/no-non-barrel-index": "error",
|
|
25
|
-
"exadev/no-non-barrel-reexport": "error",
|
|
26
|
-
"exadev/no-pointless-reassignment": "error",
|
|
27
|
-
"exadev/no-side-effects-in-index": "error",
|
|
28
|
-
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
barrel: {
|
|
32
|
-
plugins: { exadev: plugin },
|
|
33
|
-
rules: {
|
|
34
|
-
"exadev/no-non-barrel-index": "error",
|
|
35
|
-
"exadev/no-non-barrel-reexport": "error",
|
|
36
|
-
"exadev/no-side-effects-in-index": "error"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
//#endregion
|
|
41
|
-
Object.defineProperty(exports, "plugin", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function() {
|
|
44
|
-
return plugin;
|
|
45
|
-
}
|
|
46
|
-
});
|
package/dist/plugin-UsvTGA6w.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import noNonBarrelIndex from "./rules/no-non-barrel-index.js";
|
|
2
|
-
import noNonBarrelReexport from "./rules/no-non-barrel-reexport.js";
|
|
3
|
-
import noPointlessReassignment from "./rules/no-pointless-reassignment.js";
|
|
4
|
-
import noSideEffectsInIndex from "./rules/no-side-effects-in-index.js";
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/plugin.ts
|
|
7
|
-
const plugin = {
|
|
8
|
-
meta: {
|
|
9
|
-
name: "@exadev/eslint-config",
|
|
10
|
-
version: "1.1.2",
|
|
11
|
-
namespace: "exadev"
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
"no-non-barrel-index": noNonBarrelIndex,
|
|
15
|
-
"no-non-barrel-reexport": noNonBarrelReexport,
|
|
16
|
-
"no-pointless-reassignment": noPointlessReassignment,
|
|
17
|
-
"no-side-effects-in-index": noSideEffectsInIndex
|
|
18
|
-
},
|
|
19
|
-
configs: {}
|
|
20
|
-
};
|
|
21
|
-
const { configs } = plugin;
|
|
22
|
-
if (configs === void 0) throw new Error("Unreachable: configs was just initialized to {} in the object literal above.");
|
|
23
|
-
Object.assign(configs, {
|
|
24
|
-
recommended: {
|
|
25
|
-
plugins: { exadev: plugin },
|
|
26
|
-
linterOptions: { noInlineConfig: true },
|
|
27
|
-
rules: {
|
|
28
|
-
"exadev/no-non-barrel-index": "error",
|
|
29
|
-
"exadev/no-non-barrel-reexport": "error",
|
|
30
|
-
"exadev/no-pointless-reassignment": "error",
|
|
31
|
-
"exadev/no-side-effects-in-index": "error",
|
|
32
|
-
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }]
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
barrel: {
|
|
36
|
-
plugins: { exadev: plugin },
|
|
37
|
-
rules: {
|
|
38
|
-
"exadev/no-non-barrel-index": "error",
|
|
39
|
-
"exadev/no-non-barrel-reexport": "error",
|
|
40
|
-
"exadev/no-side-effects-in-index": "error"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
//#endregion
|
|
45
|
-
export { plugin as t };
|