@noctcore/eslint-utils 0.1.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/dist/index.cjs ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ AST_NODE_TYPES: () => import_utils2.AST_NODE_TYPES,
24
+ ESLintUtils: () => import_utils2.ESLintUtils,
25
+ makeCreateRule: () => makeCreateRule
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/createRule.ts
30
+ var import_utils = require("@typescript-eslint/utils");
31
+ var REPO = "https://github.com/noctcore/eslint-plugins";
32
+ var makeCreateRule = (domain) => import_utils.ESLintUtils.RuleCreator(
33
+ (ruleName) => `${REPO}/blob/main/packages/eslint-plugin-${domain}/docs/rules/${ruleName}.md`
34
+ );
35
+
36
+ // src/index.ts
37
+ var import_utils2 = require("@typescript-eslint/utils");
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ AST_NODE_TYPES,
41
+ ESLintUtils,
42
+ makeCreateRule
43
+ });
@@ -0,0 +1,20 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ export { AST_NODE_TYPES, ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
3
+
4
+ /**
5
+ * Build a typed `RuleCreator` for a `@noctcore` plugin package.
6
+ *
7
+ * `domain` is the plugin's short name (e.g. `react`, `architecture`). It is
8
+ * cosmetic — it only points each rule's docs URL at
9
+ * `packages/eslint-plugin-<domain>/docs/rules/<rule>.md`.
10
+ *
11
+ * ```ts
12
+ * // packages/eslint-plugin-react/src/createRule.ts
13
+ * export const createRule = makeCreateRule('react');
14
+ * ```
15
+ */
16
+ declare const makeCreateRule: (domain: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
17
+ name: string;
18
+ };
19
+
20
+ export { makeCreateRule };
@@ -0,0 +1,20 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ export { AST_NODE_TYPES, ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
3
+
4
+ /**
5
+ * Build a typed `RuleCreator` for a `@noctcore` plugin package.
6
+ *
7
+ * `domain` is the plugin's short name (e.g. `react`, `architecture`). It is
8
+ * cosmetic — it only points each rule's docs URL at
9
+ * `packages/eslint-plugin-<domain>/docs/rules/<rule>.md`.
10
+ *
11
+ * ```ts
12
+ * // packages/eslint-plugin-react/src/createRule.ts
13
+ * export const createRule = makeCreateRule('react');
14
+ * ```
15
+ */
16
+ declare const makeCreateRule: (domain: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
17
+ name: string;
18
+ };
19
+
20
+ export { makeCreateRule };
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ // src/createRule.ts
2
+ import { ESLintUtils } from "@typescript-eslint/utils";
3
+ var REPO = "https://github.com/noctcore/eslint-plugins";
4
+ var makeCreateRule = (domain) => ESLintUtils.RuleCreator(
5
+ (ruleName) => `${REPO}/blob/main/packages/eslint-plugin-${domain}/docs/rules/${ruleName}.md`
6
+ );
7
+
8
+ // src/index.ts
9
+ import { AST_NODE_TYPES, ESLintUtils as ESLintUtils2 } from "@typescript-eslint/utils";
10
+ export {
11
+ AST_NODE_TYPES,
12
+ ESLintUtils2 as ESLintUtils,
13
+ makeCreateRule
14
+ };
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@noctcore/eslint-utils",
3
+ "version": "0.1.0",
4
+ "description": "Shared rule-creator and AST helpers for @noctcore ESLint plugins.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": ["dist"],
19
+ "sideEffects": false,
20
+ "keywords": ["eslint", "noctcore", "eslint-utils"],
21
+ "publishConfig": {
22
+ "access": "public",
23
+ "provenance": true
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/noctcore/eslint-plugins.git",
28
+ "directory": "packages/eslint-utils"
29
+ },
30
+ "homepage": "https://github.com/noctcore/eslint-plugins/tree/main/packages/eslint-utils",
31
+ "bugs": "https://github.com/noctcore/eslint-plugins/issues",
32
+ "scripts": {
33
+ "build": "tsup src/index.ts --format esm,cjs --dts --clean",
34
+ "typecheck": "tsc --noEmit",
35
+ "test": "echo \"(no unit tests)\""
36
+ },
37
+ "dependencies": {
38
+ "@typescript-eslint/utils": "^8.61.1"
39
+ },
40
+ "peerDependencies": {
41
+ "eslint": ">=9.0.0",
42
+ "typescript": ">=5.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^22.0.0",
46
+ "tsup": "^8.5.1",
47
+ "typescript": "^5.6.0"
48
+ }
49
+ }