@storm-software/eslint-plugin-bun 0.0.39 → 0.0.41
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/dist/configs/index.d.mts +0 -2
- package/dist/configs/index.mjs +1 -2
- package/dist/configs/recommended.d.mts +0 -2
- package/dist/configs/recommended.mjs +2 -3
- package/dist/helpers/bun-workspace.d.mts +0 -2
- package/dist/helpers/bun-workspace.mjs +1 -2
- package/dist/helpers/create-rule.d.mts +0 -2
- package/dist/helpers/create-rule.mjs +1 -2
- package/dist/helpers/iterate-dependencies.d.mts +0 -2
- package/dist/helpers/iterate-dependencies.mjs +1 -2
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +2 -3
- package/dist/{plugin-2aYVzZp2.mjs → plugin-D1FLZo-e.mjs} +2 -4
- package/dist/plugin.d.mts +0 -2
- package/dist/plugin.mjs +1 -1
- package/dist/rules/json-enforce-catalog.d.mts +0 -2
- package/dist/rules/json-enforce-catalog.mjs +1 -2
- package/dist/rules/json-no-duplicate-catalog-item.d.mts +0 -2
- package/dist/rules/json-no-duplicate-catalog-item.mjs +1 -2
- package/dist/rules/json-no-unused-catalog-item.d.mts +0 -2
- package/dist/rules/json-no-unused-catalog-item.mjs +1 -2
- package/dist/rules/json-valid-catalog.d.mts +0 -2
- package/dist/rules/json-valid-catalog.mjs +1 -2
- package/package.json +5 -5
package/dist/configs/index.d.mts
CHANGED
package/dist/configs/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as plugin } from "../plugin-
|
|
1
|
+
import { t as plugin } from "../plugin-D1FLZo-e.mjs";
|
|
2
2
|
import { GLOB_EXCLUDE } from "@storm-software/package-constants/globs";
|
|
3
3
|
import parserJsonc from "jsonc-eslint-parser";
|
|
4
|
-
|
|
4
|
+
// src/configs/recommended.ts
|
|
5
5
|
const config = [{
|
|
6
6
|
name: "bun/recommended/setup",
|
|
7
7
|
plugins: { bun: plugin }
|
|
@@ -29,5 +29,4 @@ const config = [{
|
|
|
29
29
|
"bun/json-no-duplicate-catalog-item": "error"
|
|
30
30
|
}
|
|
31
31
|
}];
|
|
32
|
-
//#endregion
|
|
33
32
|
export { config as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/helpers/bun-workspace.d.ts
|
|
2
1
|
interface BunWorkspacePackageJson {
|
|
3
2
|
catalog?: Record<string, string>;
|
|
4
3
|
catalogs?: Record<string, Record<string, string>>;
|
|
@@ -45,5 +44,4 @@ declare function getBunWorkspace(cwd?: string): BunWorkspace;
|
|
|
45
44
|
declare function resetBunWorkspaceCache(): void;
|
|
46
45
|
declare function isRootWorkspacePackageJson(filename: string, cwd?: string): boolean;
|
|
47
46
|
declare function collectWorkspacePackageJsonPaths(workspaceRoot: BunWorkspace): string[];
|
|
48
|
-
//#endregion
|
|
49
47
|
export { BunWorkspace, BunWorkspacePackageJson, CatalogName, SpecifierConflicts, collectWorkspacePackageJsonPaths, getBunWorkspace, isRootWorkspacePackageJson, readBunWorkspace, resetBunWorkspaceCache };
|
|
@@ -3,7 +3,7 @@ import process from "node:process";
|
|
|
3
3
|
import { findUpSync } from "find-up-simple";
|
|
4
4
|
import { dirname, normalize, resolve } from "pathe";
|
|
5
5
|
import { globSync } from "tinyglobby";
|
|
6
|
-
|
|
6
|
+
// src/helpers/bun-workspace.ts
|
|
7
7
|
function isWorkspaceObject(workspaces) {
|
|
8
8
|
return Boolean(workspaces) && typeof workspaces === "object" && !Array.isArray(workspaces);
|
|
9
9
|
}
|
|
@@ -214,5 +214,4 @@ function collectWorkspacePackageJsonPaths(workspaceRoot) {
|
|
|
214
214
|
dirs.push(root);
|
|
215
215
|
return dirs.map((dir) => resolve(dir, "package.json")).filter((path) => fs.existsSync(path)).sort();
|
|
216
216
|
}
|
|
217
|
-
//#endregion
|
|
218
217
|
export { collectWorkspacePackageJsonPaths, getBunWorkspace, isRootWorkspacePackageJson, readBunWorkspace, resetBunWorkspaceCache };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Rule } from "eslint";
|
|
2
2
|
import { RuleWithMetaAndName } from "@typescript-eslint/utils/eslint-utils";
|
|
3
|
-
//#region src/helpers/create-rule.d.ts
|
|
4
3
|
type RuleModule<T extends readonly unknown[]> = Rule.RuleModule & {
|
|
5
4
|
defaultOptions: T;
|
|
6
5
|
};
|
|
7
6
|
declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string>({ name, meta, ...rule }: Readonly<RuleWithMetaAndName<TOptions, TMessageIds>>) => RuleModule<TOptions>;
|
|
8
|
-
//#endregion
|
|
9
7
|
export { RuleModule, createRule };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defu from "defu";
|
|
2
|
-
|
|
2
|
+
// src/helpers/create-rule.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates reusable function to create rules with default options and docs URLs.
|
|
5
5
|
*
|
|
@@ -37,5 +37,4 @@ function createRuleInfo({ create, defaultOptions, meta }) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
const createRule = RuleCreator((ruleName) => `https://docs.stormsoftware.com/projects/storm-ops/eslint-plugin-bun/rules/${ruleName}.md`);
|
|
40
|
-
//#endregion
|
|
41
40
|
export { createRule };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
|
|
2
|
-
//#region src/helpers/iterate-dependencies.d.ts
|
|
3
2
|
declare function getPackageJsonRootNode(context: RuleContext<string, unknown[]>): any | undefined;
|
|
4
3
|
declare function iterateDependencies(context: RuleContext<string, unknown[]>, fields: string[]): Generator<{
|
|
5
4
|
packageName: string;
|
|
@@ -7,5 +6,4 @@ declare function iterateDependencies(context: RuleContext<string, unknown[]>, fi
|
|
|
7
6
|
property: any;
|
|
8
7
|
}, void, unknown>;
|
|
9
8
|
declare function getObjectPath(obj: Record<string, unknown>, path: string[]): Record<string, string> | undefined;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { getObjectPath, getPackageJsonRootNode, iterateDependencies };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/iterate-dependencies.ts
|
|
2
2
|
function getPackageJsonRootNode(context) {
|
|
3
3
|
if (!context.filename.endsWith("package.json")) return;
|
|
4
4
|
const root = context.sourceCode.ast.body[0];
|
|
@@ -39,5 +39,4 @@ function getObjectPath(obj, path) {
|
|
|
39
39
|
}
|
|
40
40
|
return current;
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { getObjectPath, getPackageJsonRootNode, iterateDependencies };
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { configs } from "./configs/index.mjs";
|
|
|
2
2
|
import { RuleModule } from "./helpers/create-rule.mjs";
|
|
3
3
|
import { plugin } from "./plugin.mjs";
|
|
4
4
|
import { ESLint, Linter } from "eslint";
|
|
5
|
-
//#region src/index.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* ESLint plugin for Storm Software to enforce Bun catalog usage across monorepo packages.
|
|
8
7
|
*
|
|
@@ -48,5 +47,4 @@ declare const rules: {
|
|
|
48
47
|
type RuleDefinitions = (typeof plugin)["rules"];
|
|
49
48
|
type RuleOptions = { [K in keyof RuleDefinitions]: RuleDefinitions[K]["defaultOptions"]; };
|
|
50
49
|
type Rules = { [K in keyof RuleOptions]: Linter.RuleEntry<RuleOptions[K]>; };
|
|
51
|
-
//#endregion
|
|
52
50
|
export { RuleOptions, Rules, configs, eslintPlugin as default, rules };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as plugin } from "./plugin-
|
|
1
|
+
import { t as plugin } from "./plugin-D1FLZo-e.mjs";
|
|
2
2
|
import { configs } from "./configs/index.mjs";
|
|
3
|
-
|
|
3
|
+
// src/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* ESLint plugin for Storm Software to enforce Bun catalog usage across monorepo packages.
|
|
6
6
|
*
|
|
@@ -26,5 +26,4 @@ const eslintPlugin = {
|
|
|
26
26
|
configs
|
|
27
27
|
};
|
|
28
28
|
const rules = plugin.rules;
|
|
29
|
-
//#endregion
|
|
30
29
|
export { configs, eslintPlugin as default, rules };
|
|
@@ -2,12 +2,11 @@ import json_enforce_catalog_default from "./rules/json-enforce-catalog.mjs";
|
|
|
2
2
|
import json_no_duplicate_catalog_item_default from "./rules/json-no-duplicate-catalog-item.mjs";
|
|
3
3
|
import json_no_unused_catalog_item_default from "./rules/json-no-unused-catalog-item.mjs";
|
|
4
4
|
import json_valid_catalog_default from "./rules/json-valid-catalog.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/plugin.ts
|
|
5
|
+
// src/plugin.ts
|
|
7
6
|
const plugin = {
|
|
8
7
|
meta: {
|
|
9
8
|
name: "bun",
|
|
10
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.40"
|
|
11
10
|
},
|
|
12
11
|
rules: {
|
|
13
12
|
"json-enforce-catalog": json_enforce_catalog_default,
|
|
@@ -16,5 +15,4 @@ const plugin = {
|
|
|
16
15
|
"json-no-duplicate-catalog-item": json_no_duplicate_catalog_item_default
|
|
17
16
|
}
|
|
18
17
|
};
|
|
19
|
-
//#endregion
|
|
20
18
|
export { plugin as t };
|
package/dist/plugin.d.mts
CHANGED
package/dist/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as plugin } from "./plugin-
|
|
1
|
+
export { t as plugin } from "./plugin-D1FLZo-e.mjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RuleModule } from "../helpers/create-rule.mjs";
|
|
2
|
-
//#region src/rules/json-enforce-catalog.d.ts
|
|
3
2
|
type Options = [{
|
|
4
3
|
allowedProtocols?: string[];
|
|
5
4
|
autofix?: boolean;
|
|
@@ -10,5 +9,4 @@ type Options = [{
|
|
|
10
9
|
ignore?: string[];
|
|
11
10
|
}];
|
|
12
11
|
declare const _default: RuleModule<Options>;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { _default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRule } from "../helpers/create-rule.mjs";
|
|
2
2
|
import { getBunWorkspace } from "../helpers/bun-workspace.mjs";
|
|
3
3
|
import { iterateDependencies } from "../helpers/iterate-dependencies.mjs";
|
|
4
|
-
|
|
4
|
+
// src/rules/json-enforce-catalog.ts
|
|
5
5
|
const RULE_NAME = "json-enforce-catalog";
|
|
6
6
|
const DEFAULT_FIELDS = ["dependencies", "devDependencies"];
|
|
7
7
|
const IGNORED_DEPENDENCIES = ["typescript"];
|
|
@@ -101,5 +101,4 @@ var json_enforce_catalog_default = createRule({
|
|
|
101
101
|
return {};
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
//#endregion
|
|
105
104
|
export { json_enforce_catalog_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRule } from "../helpers/create-rule.mjs";
|
|
2
2
|
import { getBunWorkspace, isRootWorkspacePackageJson } from "../helpers/bun-workspace.mjs";
|
|
3
3
|
import { getPackageJsonRootNode } from "../helpers/iterate-dependencies.mjs";
|
|
4
|
-
|
|
4
|
+
// src/rules/json-no-duplicate-catalog-item.ts
|
|
5
5
|
const RULE_NAME = "json-no-duplicate-catalog-item";
|
|
6
6
|
function getProperty(node, key) {
|
|
7
7
|
return node?.properties?.find((property) => property.key.type === "JSONLiteral" && property.key.value === key);
|
|
@@ -73,5 +73,4 @@ var json_no_duplicate_catalog_item_default = createRule({
|
|
|
73
73
|
return {};
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
-
//#endregion
|
|
77
76
|
export { json_no_duplicate_catalog_item_default as default };
|
|
@@ -2,7 +2,7 @@ import { createRule } from "../helpers/create-rule.mjs";
|
|
|
2
2
|
import { collectWorkspacePackageJsonPaths, getBunWorkspace, isRootWorkspacePackageJson } from "../helpers/bun-workspace.mjs";
|
|
3
3
|
import { getObjectPath, getPackageJsonRootNode } from "../helpers/iterate-dependencies.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
|
-
|
|
5
|
+
// src/rules/json-no-unused-catalog-item.ts
|
|
6
6
|
const RULE_NAME = "json-no-unused-catalog-item";
|
|
7
7
|
const FIELDS = [
|
|
8
8
|
"dependencies",
|
|
@@ -72,5 +72,4 @@ var json_no_unused_catalog_item_default = createRule({
|
|
|
72
72
|
return {};
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
//#endregion
|
|
76
75
|
export { json_no_unused_catalog_item_default as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RuleModule } from "../helpers/create-rule.mjs";
|
|
2
|
-
//#region src/rules/json-valid-catalog.d.ts
|
|
3
2
|
type Options = [{
|
|
4
3
|
autoInsert?: boolean;
|
|
5
4
|
autoInsertDefaultSpecifier?: string;
|
|
@@ -7,5 +6,4 @@ type Options = [{
|
|
|
7
6
|
fields?: string[];
|
|
8
7
|
}];
|
|
9
8
|
declare const _default: RuleModule<Options>;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { _default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRule } from "../helpers/create-rule.mjs";
|
|
2
2
|
import { getBunWorkspace } from "../helpers/bun-workspace.mjs";
|
|
3
3
|
import { iterateDependencies } from "../helpers/iterate-dependencies.mjs";
|
|
4
|
-
|
|
4
|
+
// src/rules/json-valid-catalog.ts
|
|
5
5
|
const RULE_NAME = "json-valid-catalog";
|
|
6
6
|
const DEFAULT_FIELDS = [
|
|
7
7
|
"dependencies",
|
|
@@ -80,5 +80,4 @@ var json_valid_catalog_default = createRule({
|
|
|
80
80
|
return {};
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
//#endregion
|
|
84
83
|
export { json_valid_catalog_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/eslint-plugin-bun",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An ESLint Plugin that enforces Bun catalog rules in Storm Software projects.",
|
|
6
6
|
"keywords": ["eslint", "eslint-plugin", "storm-software", "bun", "catalog"],
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
},
|
|
56
56
|
"files": ["dist"],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@storm-software/package-constants": "0.1.
|
|
59
|
-
"@typescript-eslint/utils": "^8.
|
|
58
|
+
"@storm-software/package-constants": "0.1.165",
|
|
59
|
+
"@typescript-eslint/utils": "^8.72.0",
|
|
60
60
|
"defu": "^6.1.7",
|
|
61
61
|
"find-up-simple": "^1.0.1",
|
|
62
62
|
"jsonc-eslint-parser": "^2.4.2",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/compat": "^2.1.1",
|
|
68
68
|
"@eslint/config-inspector": "^1.5.0",
|
|
69
|
-
"@storm-software/prettier": "0.59.
|
|
69
|
+
"@storm-software/prettier": "0.59.206",
|
|
70
70
|
"@types/eslint": "^9.6.1",
|
|
71
71
|
"@types/eslint__js": "^8.42.3",
|
|
72
72
|
"@types/estree": "^1.0.9",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"peerDependencies": { "eslint": ">=9.39.3" },
|
|
82
82
|
"peerDependenciesMeta": { "eslint": { "optional": false } },
|
|
83
83
|
"publishConfig": { "access": "public" },
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "7a502e974b390096b201737b87f85e793499bad2"
|
|
85
85
|
}
|