@zayne-labs/eslint-config 0.11.6 → 0.11.8

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.
@@ -0,0 +1,139 @@
1
+ import { D as TypedFlatConfigItem, t as Awaitable } from "./index-B9wn5XKH.js";
2
+ import { ESLint } from "eslint";
3
+
4
+ //#region src/utils.d.ts
5
+ declare const isObject: <TObject extends object>(value: unknown) => value is TObject;
6
+ /**
7
+ * @description - Combine array and non-array configs into a single array.
8
+ */
9
+ declare const combine: (...configs: Array<Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[]>>) => Promise<TypedFlatConfigItem[]>;
10
+ declare const interopDefault: <TModule>(module: Awaitable<TModule>) => Promise<TModule extends {
11
+ default: infer TDefaultExport;
12
+ } ? TDefaultExport : TModule>;
13
+ /**
14
+ * @description - Rename plugin prefixes in a rule object.
15
+ * Accepts a map of prefixes to rename.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { renameRules } from '@zayne-labs/eslint-config'
20
+ *
21
+ * export default [{
22
+ * rules: renameRules(
23
+ * {
24
+ * '@typescript-eslint/indent': 'error'
25
+ * },
26
+ * { '@typescript-eslint': 'ts' }
27
+ * )
28
+ * }]
29
+ * ```
30
+ */
31
+ declare const renameRules: (rules: Record<string, unknown> | undefined, renameMap: Record<string, string>) => TypedFlatConfigItem["rules"] | undefined;
32
+ declare const renamePlugins: (plugins: Record<string, unknown> | undefined, renameMap: Record<string, string>) => Record<string, ESLint.Plugin> | undefined;
33
+ type OverrideConfigsOptions = {
34
+ configArray: TypedFlatConfigItem[];
35
+ overrides: TypedFlatConfigItem | ((config: TypedFlatConfigItem) => TypedFlatConfigItem);
36
+ };
37
+ /**
38
+ * @description - Override configurations in a flat configs array with either a static config object or a function that returns a config object
39
+ * @param options - Configuration options
40
+ * @param options.configs - Array of flat config items to override
41
+ * @param options.overrides - Either a config object to merge or a function that takes a config and returns overrides
42
+ * @returns Array of merged config items with overrides applied
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * import { overrideConfigs } from '@zayne-labs/eslint-config'
47
+ *
48
+ * // Override with static config
49
+ * overrideConfigs({
50
+ * configArray: existingConfigs,
51
+ * overrides: {
52
+ * rules: {
53
+ * 'no-console': 'error'
54
+ * }
55
+ * }
56
+ * })
57
+ *
58
+ * // Override with function
59
+ * overrideConfigs({
60
+ * configArray: existingConfigs,
61
+ * overrides: (config) => ({
62
+ * ...config,
63
+ * rules: {
64
+ * ...config.rules,
65
+ * 'no-console': 'error'
66
+ * }
67
+ * })
68
+ * })
69
+ * ```
70
+ */
71
+ declare const overrideConfigs: (options: OverrideConfigsOptions) => TypedFlatConfigItem[];
72
+ type RenamePluginInConfigsOptions = {
73
+ configArray: OverrideConfigsOptions["configArray"];
74
+ overrides?: OverrideConfigsOptions["overrides"];
75
+ renameMap: Record<string, string>;
76
+ };
77
+ /**
78
+ * @description - Rename plugin names and rules in a flat configs array
79
+ *
80
+ * @param options - Configuration options
81
+ * @param options.configArray - Array of flat config items to process
82
+ * @param options.overrides - Optional config overrides to apply
83
+ * @param options.renameMap - Map of old plugin names to new names
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * import { renamePluginInConfigs } from '@zayne-labs/eslint-config'
88
+ * import someConfigs from './some-configs'
89
+ *
90
+ * renamePluginInConfigs({
91
+ * configArray: someConfigs,
92
+ * renameMap: {
93
+ * '@typescript-eslint': 'ts',
94
+ * 'import-x': 'import',
95
+ * }
96
+ * })
97
+ * ```
98
+ */
99
+ declare const renamePluginInConfigs: (options: RenamePluginInConfigsOptions) => TypedFlatConfigItem[];
100
+ declare const isPackageInScope: (name: string) => boolean;
101
+ /**
102
+ * @description
103
+ * - Ensures that packages are installed in the current scope.
104
+ * - If they are not installed, and the user is in a TTY, and the user is not in a CI environment,
105
+ * and the user is in the same scope as this package, then prompt the user to
106
+ * install the packages.
107
+ *
108
+ * @param packages - The packages to ensure are installed.
109
+ */
110
+ declare const ensurePackages: (packages: Array<string | undefined>) => Promise<void>;
111
+ declare const resolveOptions: <TObject>(option: boolean | TObject | undefined) => TObject;
112
+ declare const parserPlain: {
113
+ meta: {
114
+ name: string;
115
+ };
116
+ parseForESLint: (code: string) => {
117
+ ast: {
118
+ body: never[];
119
+ comments: never[];
120
+ loc: {
121
+ end: number;
122
+ start: number;
123
+ };
124
+ range: number[];
125
+ tokens: never[];
126
+ type: string;
127
+ };
128
+ scopeManager: null;
129
+ services: {
130
+ isPlain: boolean;
131
+ };
132
+ visitorKeys: {
133
+ Program: never[];
134
+ };
135
+ };
136
+ };
137
+ //#endregion
138
+ export { combine, ensurePackages, interopDefault, isObject, isPackageInScope, overrideConfigs, parserPlain, renamePluginInConfigs, renamePlugins, renameRules, resolveOptions };
139
+ //# sourceMappingURL=utils.d.ts.map
package/dist/utils.js ADDED
@@ -0,0 +1,3 @@
1
+ import { a as isPackageInScope, c as renamePluginInConfigs, d as resolveOptions, i as isObject, l as renamePlugins, n as ensurePackages, o as overrideConfigs, r as interopDefault, s as parserPlain, t as combine, u as renameRules } from "./utils-DPFNmhr6.js";
2
+
3
+ export { combine, ensurePackages, interopDefault, isObject, isPackageInScope, overrideConfigs, parserPlain, renamePluginInConfigs, renamePlugins, renameRules, resolveOptions };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/eslint-config",
3
3
  "type": "module",
4
- "version": "0.11.6",
4
+ "version": "0.11.8",
5
5
  "description": "Zayne Labs' ESLint config preset",
6
6
  "author": "Ryan Zayne",
7
7
  "license": "MIT",
@@ -16,7 +16,9 @@
16
16
  "keywords": [],
17
17
  "sideEffects": false,
18
18
  "exports": {
19
- ".": "./dist/index.js"
19
+ ".": "./dist/index.js",
20
+ "./constants/*": "./dist/constants/*.js",
21
+ "./utils": "./dist/utils.js"
20
22
  },
21
23
  "bin": "./bin/index.js",
22
24
  "files": [
@@ -39,7 +41,6 @@
39
41
  "eslint-plugin-depend": "1.x.x",
40
42
  "eslint-plugin-erasable-syntax-only": "0.x.x",
41
43
  "eslint-plugin-jsx-a11y": "6.x.x",
42
- "eslint-plugin-pnpm": "1.x.x",
43
44
  "eslint-plugin-react-hooks": "7.x.x",
44
45
  "eslint-plugin-react-refresh": "0.x.x",
45
46
  "eslint-plugin-solid": "0.x.x",
@@ -82,9 +83,6 @@
82
83
  "eslint-plugin-jsx-a11y": {
83
84
  "optional": true
84
85
  },
85
- "eslint-plugin-pnpm": {
86
- "optional": true
87
- },
88
86
  "eslint-plugin-react-hooks": {
89
87
  "optional": true
90
88
  },
@@ -118,7 +116,7 @@
118
116
  "@eslint/js": "9.39.2",
119
117
  "@eslint/markdown": "^7.5.1",
120
118
  "@stylistic/eslint-plugin": "5.6.1",
121
- "@zayne-labs/toolkit-type-helpers": "0.12.16",
119
+ "@zayne-labs/toolkit-type-helpers": "0.12.17",
122
120
  "ansis": "4.2.0",
123
121
  "cac": "6.7.14",
124
122
  "eslint-config-flat-gitignore": "2.1.0",
@@ -129,7 +127,8 @@
129
127
  "eslint-plugin-jsdoc": "61.5.0",
130
128
  "eslint-plugin-jsonc": "2.21.0",
131
129
  "eslint-plugin-n": "17.23.1",
132
- "eslint-plugin-perfectionist": "5.0.0",
130
+ "eslint-plugin-perfectionist": "5.1.0",
131
+ "eslint-plugin-pnpm": "1.4.3",
133
132
  "eslint-plugin-security": "3.0.1",
134
133
  "eslint-plugin-toml": "^0.12.0",
135
134
  "eslint-plugin-unicorn": "62.0.0",
@@ -139,14 +138,14 @@
139
138
  "local-pkg": "1.1.2",
140
139
  "parse-gitignore": "2.0.0",
141
140
  "toml-eslint-parser": "0.10.1",
142
- "typescript-eslint": "8.50.0",
141
+ "typescript-eslint": "8.50.1",
143
142
  "yaml-eslint-parser": "1.3.2"
144
143
  },
145
144
  "devDependencies": {
146
145
  "@arethetypeswrong/cli": "0.18.2",
147
146
  "@changesets/cli": "2.29.8",
148
- "@eslint-react/eslint-plugin": "2.3.13",
149
- "@next/eslint-plugin-next": "16.1.0",
147
+ "@eslint-react/eslint-plugin": "2.4.0",
148
+ "@next/eslint-plugin-next": "16.1.1",
150
149
  "@tanstack/eslint-plugin-query": "5.91.2",
151
150
  "@tanstack/eslint-plugin-router": "1.141.0",
152
151
  "@total-typescript/ts-reset": "0.6.1",
@@ -164,7 +163,6 @@
164
163
  "eslint-plugin-depend": "1.4.0",
165
164
  "eslint-plugin-erasable-syntax-only": "0.4.0",
166
165
  "eslint-plugin-jsx-a11y": "^6.10.2",
167
- "eslint-plugin-pnpm": "1.4.3",
168
166
  "eslint-plugin-react-hooks": "7.0.1",
169
167
  "eslint-plugin-react-refresh": "0.4.26",
170
168
  "eslint-plugin-react-you-might-not-need-an-effect": "0.8.1",
@@ -175,7 +173,6 @@
175
173
  "eslint-typegen": "2.3.0",
176
174
  "find-up-simple": "^1.0.1",
177
175
  "husky": "9.1.7",
178
- "lint-staged": "16.2.7",
179
176
  "pkg-pr-new": "0.0.62",
180
177
  "prettier": "3.7.4",
181
178
  "publint": "0.3.16",
@@ -184,7 +181,7 @@
184
181
  "tsx": "4.21.0",
185
182
  "typescript": "5.9.3",
186
183
  "vue-eslint-parser": "10.2.0",
187
- "@zayne-labs/tsconfig": "0.11.6"
184
+ "@zayne-labs/tsconfig": "0.11.8"
188
185
  },
189
186
  "publishConfig": {
190
187
  "access": "public",