@exadev/eslint-config 1.1.1 → 1.2.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 +66 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-Cq16p_yl.js +45 -0
- package/dist/plugin-Dixk0WAc.cjs +46 -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 +8 -2
- package/dist/plugin-BBix8yMe.js +0 -45
- package/dist/plugin-jELHVCCw.cjs +0 -46
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @exadev/eslint-config
|
|
2
2
|
|
|
3
|
+
[](https://github.com/ExaDev/eslint-config) [](https://www.npmjs.com/package/@exadev/eslint-config) [](https://github.com/ExaDev/eslint-config/releases/latest) [](https://github.com/ExaDev/eslint-config/actions)
|
|
4
|
+
|
|
3
5
|
> 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
6
|
|
|
5
7
|
## Why
|
|
@@ -8,7 +10,9 @@ Multiple ExaDev repos independently carried identical copies of a handful of cus
|
|
|
8
10
|
|
|
9
11
|
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
12
|
|
|
11
|
-
##
|
|
13
|
+
## Getting started
|
|
14
|
+
|
|
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.
|
|
12
16
|
|
|
13
17
|
```sh
|
|
14
18
|
pnpm add -D @exadev/eslint-config
|
|
@@ -42,13 +46,39 @@ export default defineConfig([
|
|
|
42
46
|
{
|
|
43
47
|
files: ['**/*.ts'],
|
|
44
48
|
plugins: { exadev },
|
|
45
|
-
extends: ['exadev/recommended'], //
|
|
49
|
+
extends: ['exadev/recommended'], // this plugin's own four rules, plus linterOptions.noInlineConfig -- no TypeScript involvement at all
|
|
46
50
|
// or: extends: ['exadev/barrel'], // just the barrel-discipline trio (no-non-barrel-index, no-non-barrel-reexport, no-side-effects-in-index)
|
|
47
51
|
},
|
|
48
52
|
]);
|
|
49
53
|
```
|
|
50
54
|
|
|
51
|
-
`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.
|
|
52
82
|
|
|
53
83
|
## Rules
|
|
54
84
|
|
|
@@ -59,10 +89,10 @@ export default defineConfig([
|
|
|
59
89
|
| `no-pointless-reassignment` | ✓ | `const foo = bar` where both sides are plain identifiers and the alias adds no transformation. |
|
|
60
90
|
| `no-side-effects-in-index` | | The public barrel may contain only re-export statements -- nothing that could execute at import time. |
|
|
61
91
|
|
|
62
|
-
##
|
|
92
|
+
## Build, test, and lint
|
|
63
93
|
|
|
64
94
|
```sh
|
|
65
|
-
pnpm install
|
|
95
|
+
pnpm install # requires Node >=20 and pnpm 11.6.0 (pinned via packageManager)
|
|
66
96
|
pnpm lint
|
|
67
97
|
pnpm typecheck
|
|
68
98
|
pnpm build
|
|
@@ -70,9 +100,39 @@ pnpm build
|
|
|
70
100
|
|
|
71
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.
|
|
72
102
|
|
|
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
|
+
|
|
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
|
+
|
|
107
|
+
## Architecture
|
|
108
|
+
|
|
109
|
+
`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.
|
|
110
|
+
|
|
111
|
+
`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.
|
|
112
|
+
|
|
113
|
+
`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.
|
|
114
|
+
|
|
115
|
+
## Conventions
|
|
116
|
+
|
|
117
|
+
`eslint.config.ts` dogfoods this package's own rules on itself, importing `./src/index` by relative path rather than as an installed dependency. All four rules apply to this repo's own source: `no-non-barrel-reexport` is scoped to `src/**/*.ts` excluding `src/index.ts` (the barrel is where re-exports are meant to live), and `no-side-effects-in-index` is scoped to `src/index.ts` alone -- the plugin-construction logic lives in `src/plugin.ts` specifically so `src/index.ts` can stay a pure re-export point both rules assume.
|
|
118
|
+
|
|
119
|
+
`tsconfig.json` enables `verbatimModuleSyntax` (type-only imports/exports must use `import type`/`export type` explicitly -- enforced too by the `consistent-type-imports` eslint rule) and `noUncheckedIndexedAccess` (indexed access returns `T | undefined`, narrow before use rather than asserting).
|
|
120
|
+
|
|
121
|
+
Conventional commits are enforced by commitlint, restricted to the type-enum defined once in `release.config.ts`'s `commitTypes` -- both commitlint's allowed types and semantic-release's commit-analyzer release rules derive from that single list, so a commit type can't trigger a release without also being accepted by commit-msg validation, or the reverse.
|
|
122
|
+
|
|
123
|
+
## Gotchas and quirks
|
|
124
|
+
|
|
125
|
+
- `.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.
|
|
127
|
+
- 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
|
+
|
|
129
|
+
## Contributing
|
|
130
|
+
|
|
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.
|
|
132
|
+
|
|
73
133
|
## Release
|
|
74
134
|
|
|
75
|
-
Conventional commits
|
|
135
|
+
Conventional commits drive [semantic-release](https://semantic-release.gitbook.io/semantic-release) on every push to `main`: version bump, `CHANGELOG.md`, GitHub Release, and an npm publish via OIDC trusted publishing (no stored token). A second CI job then republishes the identical build under the unscoped alias `exadev-eslint-config`.
|
|
76
136
|
|
|
77
137
|
## License
|
|
78
138
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_plugin = require("./plugin-
|
|
1
|
+
const require_plugin = require("./plugin-Dixk0WAc.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-Cq16p_yl.js";
|
|
2
2
|
export { plugin as default };
|
|
@@ -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.0",
|
|
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 };
|
|
@@ -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.0",
|
|
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
|
+
});
|
package/dist/plugin.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_plugin = require("./plugin-
|
|
1
|
+
const require_plugin = require("./plugin-Dixk0WAc.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-Cq16p_yl.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-Dixk0WAc.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-Cq16p_yl.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.
|
|
3
|
+
"version": "1.2.0",
|
|
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",
|
package/dist/plugin-BBix8yMe.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.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
|
-
};
|
|
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 };
|
package/dist/plugin-jELHVCCw.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.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
|
-
};
|
|
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
|
-
});
|