@agilebot/eslint-config 0.9.4 → 0.9.6

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/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Agilebot, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Agilebot, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/dist/cli.mjs CHANGED
@@ -1,11 +1,10 @@
1
- import { t as CLI_NAME } from "./constants-DnH_FaAF.mjs";
1
+ import { t as CLI_NAME } from "./constants-B6tWxamT.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
4
  import { isCI } from "@agilebot/eslint-utils";
5
5
  import yargs from "yargs";
6
6
  import { hideBin } from "yargs/helpers";
7
7
  import ansis from "ansis";
8
-
9
8
  //#region src/cli/stages/eslint.ts
10
9
  const require = createRequire(import.meta.url);
11
10
  function patch() {
@@ -19,9 +18,9 @@ function patch() {
19
18
  }
20
19
  function runBinary() {
21
20
  const pkg = require.resolve("eslint/package.json");
22
- require(path.join(pkg, "..", "bin", "eslint.js"));
21
+ const bin = path.join(pkg, "..", "bin", "eslint.js");
22
+ require(bin);
23
23
  }
24
-
25
24
  //#endregion
26
25
  //#region src/cli/index.ts
27
26
  function cli() {
@@ -71,10 +70,8 @@ function cli() {
71
70
  if (argv.checkIntl) process.argv.splice(2, 0, "--rule", "@agilebot/intl-id-unused: 1");
72
71
  runBinary();
73
72
  }
74
-
75
73
  //#endregion
76
74
  //#region src/cli.ts
77
75
  cli();
78
-
79
76
  //#endregion
80
- export { };
77
+ export {};
@@ -65,6 +65,5 @@ const IGNORE_GLOBS = [
65
65
  "**/components.d.ts"
66
66
  ];
67
67
  const CLI_NAME = "eslint-agilebot";
68
-
69
68
  //#endregion
70
- export { JS_GLOBS as a, IGNORE_GLOBS as i, DEFAULT_GLOBS as n, TS_GLOBS as o, DTS_GLOBS as r, VUE_GLOBS as s, CLI_NAME as t };
69
+ export { JS_GLOBS as a, IGNORE_GLOBS as i, DEFAULT_GLOBS as n, TS_GLOBS as o, DTS_GLOBS as r, VUE_GLOBS as s, CLI_NAME as t };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { Options } from "@cspell/eslint-plugin";
1
+ import { Options as Options$1 } from "@cspell/eslint-plugin";
2
2
  import { Linter } from "eslint";
3
- import { Options as Options$1 } from "prettier";
4
3
 
5
4
  //#region src/types.d.ts
6
5
  interface FlatConfigItem extends Linter.Config {
@@ -9,8 +8,576 @@ interface FlatConfigItem extends Linter.Config {
9
8
  plugins?: Record<string, any>;
10
9
  }
11
10
  //#endregion
11
+ //#region ../../node_modules/.pnpm/prettier@3.5.3/node_modules/prettier/doc.d.ts
12
+ // https://github.com/prettier/prettier/blob/next/src/document/public.js
13
+ declare namespace builders {
14
+ type DocCommand = Align | BreakParent | Cursor | Fill | Group | IfBreak | Indent | IndentIfBreak | Label | Line | LineSuffix | LineSuffixBoundary | Trim;
15
+ type Doc = string | Doc[] | DocCommand;
16
+ interface Align {
17
+ type: "align";
18
+ contents: Doc;
19
+ n: number | string | {
20
+ type: "root";
21
+ };
22
+ }
23
+ interface BreakParent {
24
+ type: "break-parent";
25
+ }
26
+ interface Cursor {
27
+ type: "cursor";
28
+ placeholder: symbol;
29
+ }
30
+ interface Fill {
31
+ type: "fill";
32
+ parts: Doc[];
33
+ }
34
+ interface Group {
35
+ type: "group";
36
+ id?: symbol;
37
+ contents: Doc;
38
+ break: boolean;
39
+ expandedStates: Doc[];
40
+ }
41
+ interface HardlineWithoutBreakParent extends Line {
42
+ hard: true;
43
+ }
44
+ interface IfBreak {
45
+ type: "if-break";
46
+ breakContents: Doc;
47
+ flatContents: Doc;
48
+ }
49
+ interface Indent {
50
+ type: "indent";
51
+ contents: Doc;
52
+ }
53
+ interface IndentIfBreak {
54
+ type: "indent-if-break";
55
+ }
56
+ interface Label {
57
+ type: "label";
58
+ label: any;
59
+ contents: Doc;
60
+ }
61
+ interface Line {
62
+ type: "line";
63
+ soft?: boolean | undefined;
64
+ hard?: boolean | undefined;
65
+ literal?: boolean | undefined;
66
+ }
67
+ interface LineSuffix {
68
+ type: "line-suffix";
69
+ contents: Doc;
70
+ }
71
+ interface LineSuffixBoundary {
72
+ type: "line-suffix-boundary";
73
+ }
74
+ interface LiterallineWithoutBreakParent extends Line {
75
+ hard: true;
76
+ literal: true;
77
+ }
78
+ type LiteralLine = [LiterallineWithoutBreakParent, BreakParent];
79
+ interface Softline extends Line {
80
+ soft: true;
81
+ }
82
+ type Hardline = [HardlineWithoutBreakParent, BreakParent];
83
+ interface Trim {
84
+ type: "trim";
85
+ }
86
+ interface GroupOptions {
87
+ shouldBreak?: boolean | undefined;
88
+ id?: symbol | undefined;
89
+ }
90
+ function addAlignmentToDoc(doc: Doc, size: number, tabWidth: number): Doc;
91
+ /** @see [align](https://github.com/prettier/prettier/blob/main/commands.md#align) */
92
+ function align(widthOrString: Align["n"], doc: Doc): Align;
93
+ /** @see [breakParent](https://github.com/prettier/prettier/blob/main/commands.md#breakparent) */
94
+ const breakParent: BreakParent;
95
+ /** @see [conditionalGroup](https://github.com/prettier/prettier/blob/main/commands.md#conditionalgroup) */
96
+ function conditionalGroup(alternatives: Doc[], options?: GroupOptions): Group;
97
+ /** @see [dedent](https://github.com/prettier/prettier/blob/main/commands.md#dedent) */
98
+ function dedent(doc: Doc): Align;
99
+ /** @see [dedentToRoot](https://github.com/prettier/prettier/blob/main/commands.md#dedenttoroot) */
100
+ function dedentToRoot(doc: Doc): Align;
101
+ /** @see [fill](https://github.com/prettier/prettier/blob/main/commands.md#fill) */
102
+ function fill(docs: Doc[]): Fill;
103
+ /** @see [group](https://github.com/prettier/prettier/blob/main/commands.md#group) */
104
+ function group(doc: Doc, opts?: GroupOptions): Group;
105
+ /** @see [hardline](https://github.com/prettier/prettier/blob/main/commands.md#hardline) */
106
+ const hardline: Hardline;
107
+ /** @see [hardlineWithoutBreakParent](https://github.com/prettier/prettier/blob/main/commands.md#hardlinewithoutbreakparent-and-literallinewithoutbreakparent) */
108
+ const hardlineWithoutBreakParent: HardlineWithoutBreakParent;
109
+ /** @see [ifBreak](https://github.com/prettier/prettier/blob/main/commands.md#ifbreak) */
110
+ function ifBreak(ifBreak: Doc, noBreak?: Doc, options?: {
111
+ groupId?: symbol | undefined;
112
+ }): IfBreak;
113
+ /** @see [indent](https://github.com/prettier/prettier/blob/main/commands.md#indent) */
114
+ function indent(doc: Doc): Indent;
115
+ /** @see [indentIfBreak](https://github.com/prettier/prettier/blob/main/commands.md#indentifbreak) */
116
+ function indentIfBreak(doc: Doc, opts: {
117
+ groupId: symbol;
118
+ negate?: boolean | undefined;
119
+ }): IndentIfBreak;
120
+ /** @see [join](https://github.com/prettier/prettier/blob/main/commands.md#join) */
121
+ function join(sep: Doc, docs: Doc[]): Doc[];
122
+ /** @see [label](https://github.com/prettier/prettier/blob/main/commands.md#label) */
123
+ function label(label: any | undefined, contents: Doc): Doc;
124
+ /** @see [line](https://github.com/prettier/prettier/blob/main/commands.md#line) */
125
+ const line: Line;
126
+ /** @see [lineSuffix](https://github.com/prettier/prettier/blob/main/commands.md#linesuffix) */
127
+ function lineSuffix(suffix: Doc): LineSuffix;
128
+ /** @see [lineSuffixBoundary](https://github.com/prettier/prettier/blob/main/commands.md#linesuffixboundary) */
129
+ const lineSuffixBoundary: LineSuffixBoundary;
130
+ /** @see [literalline](https://github.com/prettier/prettier/blob/main/commands.md#literalline) */
131
+ const literalline: LiteralLine;
132
+ /** @see [literallineWithoutBreakParent](https://github.com/prettier/prettier/blob/main/commands.md#hardlinewithoutbreakparent-and-literallinewithoutbreakparent) */
133
+ const literallineWithoutBreakParent: LiterallineWithoutBreakParent;
134
+ /** @see [markAsRoot](https://github.com/prettier/prettier/blob/main/commands.md#markasroot) */
135
+ function markAsRoot(doc: Doc): Align;
136
+ /** @see [softline](https://github.com/prettier/prettier/blob/main/commands.md#softline) */
137
+ const softline: Softline;
138
+ /** @see [trim](https://github.com/prettier/prettier/blob/main/commands.md#trim) */
139
+ const trim: Trim;
140
+ /** @see [cursor](https://github.com/prettier/prettier/blob/main/commands.md#cursor) */
141
+ const cursor: Cursor;
142
+ }
143
+ declare namespace printer {
144
+ function printDocToString(doc: builders.Doc, options: Options): {
145
+ formatted: string;
146
+ /**
147
+ * This property is a misnomer, and has been since the changes in
148
+ * https://github.com/prettier/prettier/pull/15709.
149
+ * The region of the document indicated by `cursorNodeStart` and `cursorNodeText` will
150
+ * sometimes actually be what lies BETWEEN a pair of leaf nodes in the AST, rather than a node.
151
+ */
152
+ cursorNodeStart?: number | undefined;
153
+ /**
154
+ * Note that, like cursorNodeStart, this is a misnomer and may actually be the text between two
155
+ * leaf nodes in the AST instead of the text of a node.
156
+ */
157
+ cursorNodeText?: string | undefined;
158
+ };
159
+ interface Options {
160
+ /**
161
+ * Specify the line length that the printer will wrap on.
162
+ * @default 80
163
+ */
164
+ printWidth: number;
165
+ /**
166
+ * Specify the number of spaces per indentation-level.
167
+ * @default 2
168
+ */
169
+ tabWidth: number;
170
+ /**
171
+ * Indent lines with tabs instead of spaces
172
+ * @default false
173
+ */
174
+ useTabs?: boolean;
175
+ parentParser?: string | undefined;
176
+ __embeddedInHtml?: boolean | undefined;
177
+ }
178
+ }
179
+ declare namespace utils {
180
+ function willBreak(doc: builders.Doc): boolean;
181
+ function traverseDoc(doc: builders.Doc, onEnter?: (doc: builders.Doc) => void | boolean, onExit?: (doc: builders.Doc) => void, shouldTraverseConditionalGroups?: boolean): void;
182
+ function findInDoc<T = builders.Doc>(doc: builders.Doc, callback: (doc: builders.Doc) => T, defaultValue: T): T;
183
+ function mapDoc<T = builders.Doc>(doc: builders.Doc, callback: (doc: builders.Doc) => T): T;
184
+ function removeLines(doc: builders.Doc): builders.Doc;
185
+ function stripTrailingHardline(doc: builders.Doc): builders.Doc;
186
+ function replaceEndOfLine(doc: builders.Doc, replacement?: builders.Doc): builders.Doc;
187
+ function canBreak(doc: builders.Doc): boolean;
188
+ }
189
+ //#endregion
190
+ //#region ../../node_modules/.pnpm/prettier@3.5.3/node_modules/prettier/index.d.ts
191
+ declare namespace doc {
192
+ export { builders, printer, utils };
193
+ }
194
+ // This utility is here to handle the case where you have an explicit union
195
+ // between string literals and the generic string type. It would normally
196
+ // resolve out to just the string type, but this generic LiteralUnion maintains
197
+ // the intellisense of the original union.
198
+ //
199
+ // It comes from this issue: microsoft/TypeScript#29729:
200
+ // https://github.com/microsoft/TypeScript/issues/29729#issuecomment-700527227
201
+ type LiteralUnion<T extends U, U = string> = T | (Pick<U, never> & {
202
+ _?: never | undefined;
203
+ });
204
+ type Doc$1 = doc.builders.Doc;
205
+ // The type of elements that make up the given array T.
206
+ type ArrayElement<T> = T extends Array<infer E> ? E : never; // A union of the properties of the given object that are arrays.
207
+ type ArrayProperties<T> = { [K in keyof T]: NonNullable<T[K]> extends readonly any[] ? K : never }[keyof T]; // A union of the properties of the given array T that can be used to index it.
208
+ // If the array is a tuple, then that's going to be the explicit indices of the
209
+ // array, otherwise it's going to just be number.
210
+ type IndexProperties<T extends {
211
+ length: number;
212
+ }> = IsTuple<T> extends true ? Exclude<Partial<T>["length"], T["length"]> : number; // Effectively performing T[P], except that it's telling TypeScript that it's
213
+ // safe to do this for tuples, arrays, or objects.
214
+ type IndexValue<T, P> = T extends any[] ? P extends number ? T[P] : never : P extends keyof T ? T[P] : never; // Determines if an object T is an array like string[] (in which case this
215
+ // evaluates to false) or a tuple like [string] (in which case this evaluates to
216
+ // true).
217
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
218
+ type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
219
+ type CallProperties<T> = T extends any[] ? IndexProperties<T> : keyof T;
220
+ type IterProperties<T> = T extends any[] ? IndexProperties<T> : ArrayProperties<T>;
221
+ type CallCallback<T, U> = (path: AstPath<T>, index: number, value: any) => U;
222
+ type EachCallback<T> = (path: AstPath<ArrayElement<T>>, index: number, value: any) => void;
223
+ type MapCallback<T, U> = (path: AstPath<ArrayElement<T>>, index: number, value: any) => U; // https://github.com/prettier/prettier/blob/next/src/common/ast-path.js
224
+ declare class AstPath<T = any> {
225
+ constructor(value: T);
226
+ get key(): string | null;
227
+ get index(): number | null;
228
+ get node(): T;
229
+ get parent(): T | null;
230
+ get grandparent(): T | null;
231
+ get isInArray(): boolean;
232
+ get siblings(): T[] | null;
233
+ get next(): T | null;
234
+ get previous(): T | null;
235
+ get isFirst(): boolean;
236
+ get isLast(): boolean;
237
+ get isRoot(): boolean;
238
+ get root(): T;
239
+ get ancestors(): T[];
240
+ stack: T[];
241
+ callParent<U>(callback: (path: this) => U, count?: number): U;
242
+ /**
243
+ * @deprecated Please use `AstPath#key` or `AstPath#index`
244
+ */
245
+ getName(): PropertyKey | null;
246
+ /**
247
+ * @deprecated Please use `AstPath#node` or `AstPath#siblings`
248
+ */
249
+ getValue(): T;
250
+ getNode(count?: number): T | null;
251
+ getParentNode(count?: number): T | null;
252
+ match(...predicates: Array<(node: any, name: string | null, number: number | null) => boolean>): boolean; // For each of the tree walk functions (call, each, and map) this provides 5
253
+ // strict type signatures, along with a fallback at the end if you end up
254
+ // calling more than 5 properties deep. This helps a lot with typing because
255
+ // for the majority of cases you're calling fewer than 5 properties, so the
256
+ // tree walk functions have a clearer understanding of what you're doing.
257
+ //
258
+ // Note that resolving these types is somewhat complicated, and it wasn't
259
+ // even supported until TypeScript 4.2 (before it would just say that the
260
+ // type instantiation was excessively deep and possibly infinite).
261
+ call<U>(callback: CallCallback<T, U>): U;
262
+ call<U, P1 extends CallProperties<T>>(callback: CallCallback<IndexValue<T, P1>, U>, prop1: P1): U;
263
+ call<U, P1 extends keyof T, P2 extends CallProperties<T[P1]>>(callback: CallCallback<IndexValue<IndexValue<T, P1>, P2>, U>, prop1: P1, prop2: P2): U;
264
+ call<U, P1 extends keyof T, P2 extends CallProperties<T[P1]>, P3 extends CallProperties<IndexValue<T[P1], P2>>>(callback: CallCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U;
265
+ call<U, P1 extends keyof T, P2 extends CallProperties<T[P1]>, P3 extends CallProperties<IndexValue<T[P1], P2>>, P4 extends CallProperties<IndexValue<IndexValue<T[P1], P2>, P3>>>(callback: CallCallback<IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U;
266
+ call<U, P extends PropertyKey>(callback: CallCallback<any, U>, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U;
267
+ each(callback: EachCallback<T>): void;
268
+ each<P1 extends IterProperties<T>>(callback: EachCallback<IndexValue<T, P1>>, prop1: P1): void;
269
+ each<P1 extends keyof T, P2 extends IterProperties<T[P1]>>(callback: EachCallback<IndexValue<IndexValue<T, P1>, P2>>, prop1: P1, prop2: P2): void;
270
+ each<P1 extends keyof T, P2 extends IterProperties<T[P1]>, P3 extends IterProperties<IndexValue<T[P1], P2>>>(callback: EachCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>>, prop1: P1, prop2: P2, prop3: P3): void;
271
+ each<P1 extends keyof T, P2 extends IterProperties<T[P1]>, P3 extends IterProperties<IndexValue<T[P1], P2>>, P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>>(callback: EachCallback<IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): void;
272
+ each(callback: EachCallback<any[]>, prop1: PropertyKey, prop2: PropertyKey, prop3: PropertyKey, prop4: PropertyKey, ...props: PropertyKey[]): void;
273
+ map<U>(callback: MapCallback<T, U>): U[];
274
+ map<U, P1 extends IterProperties<T>>(callback: MapCallback<IndexValue<T, P1>, U>, prop1: P1): U[];
275
+ map<U, P1 extends keyof T, P2 extends IterProperties<T[P1]>>(callback: MapCallback<IndexValue<IndexValue<T, P1>, P2>, U>, prop1: P1, prop2: P2): U[];
276
+ map<U, P1 extends keyof T, P2 extends IterProperties<T[P1]>, P3 extends IterProperties<IndexValue<T[P1], P2>>>(callback: MapCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U[];
277
+ map<U, P1 extends keyof T, P2 extends IterProperties<T[P1]>, P3 extends IterProperties<IndexValue<T[P1], P2>>, P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>>(callback: MapCallback<IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U[];
278
+ map<U>(callback: MapCallback<any[], U>, prop1: PropertyKey, prop2: PropertyKey, prop3: PropertyKey, prop4: PropertyKey, ...props: PropertyKey[]): U[];
279
+ }
280
+ type BuiltInParserName = "acorn" | "angular" | "babel-flow" | "babel-ts" | "babel" | "css" | "espree" | "flow" | "glimmer" | "graphql" | "html" | "json-stringify" | "json" | "json5" | "jsonc" | "less" | "lwc" | "markdown" | "mdx" | "meriyah" | "scss" | "typescript" | "vue" | "yaml";
281
+ interface Options$3 extends Partial<RequiredOptions> {}
282
+ interface RequiredOptions extends doc.printer.Options {
283
+ /**
284
+ * Print semicolons at the ends of statements.
285
+ * @default true
286
+ */
287
+ semi: boolean;
288
+ /**
289
+ * Use single quotes instead of double quotes.
290
+ * @default false
291
+ */
292
+ singleQuote: boolean;
293
+ /**
294
+ * Use single quotes in JSX.
295
+ * @default false
296
+ */
297
+ jsxSingleQuote: boolean;
298
+ /**
299
+ * Print trailing commas wherever possible.
300
+ * @default "all"
301
+ */
302
+ trailingComma: "none" | "es5" | "all";
303
+ /**
304
+ * Print spaces between brackets in object literals.
305
+ * @default true
306
+ */
307
+ bracketSpacing: boolean;
308
+ /**
309
+ * How to wrap object literals.
310
+ * @default "preserve"
311
+ */
312
+ objectWrap: "preserve" | "collapse";
313
+ /**
314
+ * Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being
315
+ * alone on the next line (does not apply to self closing elements).
316
+ * @default false
317
+ */
318
+ bracketSameLine: boolean;
319
+ /**
320
+ * Format only a segment of a file.
321
+ * @default 0
322
+ */
323
+ rangeStart: number;
324
+ /**
325
+ * Format only a segment of a file.
326
+ * @default Number.POSITIVE_INFINITY
327
+ */
328
+ rangeEnd: number;
329
+ /**
330
+ * Specify which parser to use.
331
+ */
332
+ parser: LiteralUnion<BuiltInParserName>;
333
+ /**
334
+ * Specify the input filepath. This will be used to do parser inference.
335
+ */
336
+ filepath: string;
337
+ /**
338
+ * Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file.
339
+ * This is very useful when gradually transitioning large, unformatted codebases to prettier.
340
+ * @default false
341
+ */
342
+ requirePragma: boolean;
343
+ /**
344
+ * Prettier can insert a special @format marker at the top of files specifying that
345
+ * the file has been formatted with prettier. This works well when used in tandem with
346
+ * the --require-pragma option. If there is already a docblock at the top of
347
+ * the file then this option will add a newline to it with the @format marker.
348
+ * @default false
349
+ */
350
+ insertPragma: boolean;
351
+ /**
352
+ * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
353
+ * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
354
+ * @default "preserve"
355
+ */
356
+ proseWrap: "always" | "never" | "preserve";
357
+ /**
358
+ * Include parentheses around a sole arrow function parameter.
359
+ * @default "always"
360
+ */
361
+ arrowParens: "avoid" | "always";
362
+ /**
363
+ * Provide ability to support new languages to prettier.
364
+ */
365
+ plugins: Array<string | Plugin>;
366
+ /**
367
+ * How to handle whitespaces in HTML.
368
+ * @default "css"
369
+ */
370
+ htmlWhitespaceSensitivity: "css" | "strict" | "ignore";
371
+ /**
372
+ * Which end of line characters to apply.
373
+ * @default "lf"
374
+ */
375
+ endOfLine: "auto" | "lf" | "crlf" | "cr";
376
+ /**
377
+ * Change when properties in objects are quoted.
378
+ * @default "as-needed"
379
+ */
380
+ quoteProps: "as-needed" | "consistent" | "preserve";
381
+ /**
382
+ * Whether or not to indent the code inside <script> and <style> tags in Vue files.
383
+ * @default false
384
+ */
385
+ vueIndentScriptAndStyle: boolean;
386
+ /**
387
+ * Control whether Prettier formats quoted code embedded in the file.
388
+ * @default "auto"
389
+ */
390
+ embeddedLanguageFormatting: "auto" | "off";
391
+ /**
392
+ * Enforce single attribute per line in HTML, Vue and JSX.
393
+ * @default false
394
+ */
395
+ singleAttributePerLine: boolean;
396
+ /**
397
+ * Where to print operators when binary expressions wrap lines.
398
+ * @default "end"
399
+ */
400
+ experimentalOperatorPosition: "start" | "end";
401
+ /**
402
+ * Use curious ternaries, with the question mark after the condition, instead
403
+ * of on the same line as the consequent.
404
+ * @default false
405
+ */
406
+ experimentalTernaries: boolean;
407
+ /**
408
+ * Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
409
+ * @default false
410
+ * @deprecated use bracketSameLine instead
411
+ */
412
+ jsxBracketSameLine?: boolean;
413
+ /**
414
+ * Arbitrary additional values on an options object are always allowed.
415
+ */
416
+ [_: string]: unknown;
417
+ }
418
+ interface ParserOptions<T = any> extends RequiredOptions {
419
+ locStart: (node: T) => number;
420
+ locEnd: (node: T) => number;
421
+ originalText: string;
422
+ }
423
+ interface Plugin<T = any> {
424
+ languages?: SupportLanguage[] | undefined;
425
+ parsers?: {
426
+ [parserName: string]: Parser<T>;
427
+ } | undefined;
428
+ printers?: {
429
+ [astFormat: string]: Printer<T>;
430
+ } | undefined;
431
+ options?: SupportOptions | undefined;
432
+ defaultOptions?: Partial<RequiredOptions> | undefined;
433
+ }
434
+ interface Parser<T = any> {
435
+ parse: (text: string, options: ParserOptions<T>) => T | Promise<T>;
436
+ astFormat: string;
437
+ hasPragma?: ((text: string) => boolean) | undefined;
438
+ locStart: (node: T) => number;
439
+ locEnd: (node: T) => number;
440
+ preprocess?: ((text: string, options: ParserOptions<T>) => string) | undefined;
441
+ }
442
+ interface Printer<T = any> {
443
+ print(path: AstPath<T>, options: ParserOptions<T>, print: (path: AstPath<T>) => Doc$1, args?: unknown): Doc$1;
444
+ embed?: ((path: AstPath, options: Options$3) => ((textToDoc: (text: string, options: Options$3) => Promise<Doc$1>, print: (selector?: string | number | Array<string | number> | AstPath) => Doc$1, path: AstPath, options: Options$3) => Promise<Doc$1 | undefined> | Doc$1 | undefined) | Doc$1 | null) | undefined;
445
+ preprocess?: ((ast: T, options: ParserOptions<T>) => T | Promise<T>) | undefined;
446
+ insertPragma?: (text: string) => string;
447
+ /**
448
+ * @returns `null` if you want to remove this node
449
+ * @returns `void` if you want to use modified `cloned`
450
+ * @returns anything if you want to replace the node with it
451
+ */
452
+ massageAstNode?: ((original: any, cloned: any, parent: any) => any) | undefined;
453
+ hasPrettierIgnore?: ((path: AstPath<T>) => boolean) | undefined;
454
+ canAttachComment?: ((node: T) => boolean) | undefined;
455
+ isBlockComment?: ((node: T) => boolean) | undefined;
456
+ willPrintOwnComments?: ((path: AstPath<T>) => boolean) | undefined;
457
+ printComment?: ((commentPath: AstPath<T>, options: ParserOptions<T>) => Doc$1) | undefined;
458
+ /**
459
+ * By default, Prettier searches all object properties (except for a few predefined ones) of each node recursively.
460
+ * This function can be provided to override that behavior.
461
+ * @param node The node whose children should be returned.
462
+ * @param options Current options.
463
+ * @returns `[]` if the node has no children or `undefined` to fall back on the default behavior.
464
+ */
465
+ getCommentChildNodes?: ((node: T, options: ParserOptions<T>) => T[] | undefined) | undefined;
466
+ handleComments?: {
467
+ ownLine?: ((commentNode: any, text: string, options: ParserOptions<T>, ast: T, isLastComment: boolean) => boolean) | undefined;
468
+ endOfLine?: ((commentNode: any, text: string, options: ParserOptions<T>, ast: T, isLastComment: boolean) => boolean) | undefined;
469
+ remaining?: ((commentNode: any, text: string, options: ParserOptions<T>, ast: T, isLastComment: boolean) => boolean) | undefined;
470
+ } | undefined;
471
+ getVisitorKeys?: ((node: T, nonTraversableKeys: Set<string>) => string[]) | undefined;
472
+ }
473
+ interface SupportLanguage {
474
+ name: string;
475
+ since?: string | undefined;
476
+ parsers: BuiltInParserName[] | string[];
477
+ group?: string | undefined;
478
+ tmScope?: string | undefined;
479
+ aceMode?: string | undefined;
480
+ codemirrorMode?: string | undefined;
481
+ codemirrorMimeType?: string | undefined;
482
+ aliases?: string[] | undefined;
483
+ extensions?: string[] | undefined;
484
+ filenames?: string[] | undefined;
485
+ linguistLanguageId?: number | undefined;
486
+ vscodeLanguageIds?: string[] | undefined;
487
+ interpreters?: string[] | undefined;
488
+ }
489
+ interface SupportOptionRange {
490
+ start: number;
491
+ end: number;
492
+ step: number;
493
+ }
494
+ type SupportOptionType = "int" | "string" | "boolean" | "choice" | "path";
495
+ interface BaseSupportOption<Type extends SupportOptionType> {
496
+ readonly name?: string | undefined;
497
+ /**
498
+ * Usually you can use {@link CoreCategoryType}
499
+ */
500
+ category: string;
501
+ /**
502
+ * The type of the option.
503
+ *
504
+ * When passing a type other than the ones listed below, the option is
505
+ * treated as taking any string as argument, and `--option <${type}>` will
506
+ * be displayed in --help.
507
+ */
508
+ type: Type;
509
+ /**
510
+ * Indicate that the option is deprecated.
511
+ *
512
+ * Use a string to add an extra message to --help for the option,
513
+ * for example to suggest a replacement option.
514
+ */
515
+ deprecated?: true | string | undefined;
516
+ /**
517
+ * Description to be displayed in --help. If omitted, the option won't be
518
+ * shown at all in --help.
519
+ */
520
+ description?: string | undefined;
521
+ }
522
+ interface IntSupportOption extends BaseSupportOption<"int"> {
523
+ default?: number | undefined;
524
+ array?: false | undefined;
525
+ range?: SupportOptionRange | undefined;
526
+ }
527
+ interface IntArraySupportOption extends BaseSupportOption<"int"> {
528
+ default?: Array<{
529
+ value: number[];
530
+ }> | undefined;
531
+ array: true;
532
+ }
533
+ interface StringSupportOption extends BaseSupportOption<"string"> {
534
+ default?: string | undefined;
535
+ array?: false | undefined;
536
+ }
537
+ interface StringArraySupportOption extends BaseSupportOption<"string"> {
538
+ default?: Array<{
539
+ value: string[];
540
+ }> | undefined;
541
+ array: true;
542
+ }
543
+ interface BooleanSupportOption extends BaseSupportOption<"boolean"> {
544
+ default?: boolean | undefined;
545
+ array?: false | undefined;
546
+ description: string;
547
+ oppositeDescription?: string | undefined;
548
+ }
549
+ interface BooleanArraySupportOption extends BaseSupportOption<"boolean"> {
550
+ default?: Array<{
551
+ value: boolean[];
552
+ }> | undefined;
553
+ array: true;
554
+ }
555
+ interface ChoiceSupportOption<Value = any> extends BaseSupportOption<"choice"> {
556
+ default?: Value | Array<{
557
+ value: Value;
558
+ }> | undefined;
559
+ description: string;
560
+ choices: Array<{
561
+ since?: string | undefined;
562
+ value: Value;
563
+ description: string;
564
+ }>;
565
+ }
566
+ interface PathSupportOption extends BaseSupportOption<"path"> {
567
+ default?: string | undefined;
568
+ array?: false | undefined;
569
+ }
570
+ interface PathArraySupportOption extends BaseSupportOption<"path"> {
571
+ default?: Array<{
572
+ value: string[];
573
+ }> | undefined;
574
+ array: true;
575
+ }
576
+ type SupportOption = IntSupportOption | IntArraySupportOption | StringSupportOption | StringArraySupportOption | BooleanSupportOption | BooleanArraySupportOption | ChoiceSupportOption | PathSupportOption | PathArraySupportOption;
577
+ interface SupportOptions extends Record<string, SupportOption> {}
578
+ //#endregion
12
579
  //#region src/configs/cspell.d.ts
13
- type Options$2 = Options['cspell'];
580
+ type Options$2 = Options$1['cspell'];
14
581
  //#endregion
15
582
  //#region src/configs/imports.d.ts
16
583
  interface ImportsOptions {
@@ -87,7 +654,7 @@ interface FactoryOptions {
87
654
  * Enable Prettier for code formatting
88
655
  * @default true
89
656
  */
90
- prettier?: boolean | Options$1;
657
+ prettier?: boolean | Options$3;
91
658
  /**
92
659
  * Enable Lodash-specific linting rules
93
660
  * @default true
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as JS_GLOBS, i as IGNORE_GLOBS, n as DEFAULT_GLOBS, o as TS_GLOBS, r as DTS_GLOBS, s as VUE_GLOBS } from "./constants-DnH_FaAF.mjs";
1
+ import { a as JS_GLOBS, i as IGNORE_GLOBS, n as DEFAULT_GLOBS, o as TS_GLOBS, r as DTS_GLOBS, s as VUE_GLOBS } from "./constants-B6tWxamT.mjs";
2
2
  import assert from "node:assert";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import path from "node:path";
@@ -34,7 +34,6 @@ import pluginPrettier from "eslint-plugin-prettier";
34
34
  import configGodaddy from "eslint-config-godaddy";
35
35
  import js from "@eslint/js";
36
36
  import pluginMocha from "eslint-plugin-mocha";
37
-
38
37
  //#region src/configs/env.ts
39
38
  function env() {
40
39
  return {
@@ -50,7 +49,6 @@ function env() {
50
49
  } }
51
50
  };
52
51
  }
53
-
54
52
  //#endregion
55
53
  //#region src/configs/standard.ts
56
54
  function standard() {
@@ -483,7 +481,6 @@ function standardDisabled() {
483
481
  "v89.0.0": ["@typescript-eslint/prefer-destructuring"]
484
482
  };
485
483
  }
486
-
487
484
  //#endregion
488
485
  //#region src/configs/ts.ts
489
486
  function ts() {
@@ -607,7 +604,6 @@ function dts() {
607
604
  }
608
605
  };
609
606
  }
610
-
611
607
  //#endregion
612
608
  //#region src/configs/imports.ts
613
609
  /**
@@ -705,7 +701,6 @@ function imports(packageDir, opts) {
705
701
  }
706
702
  };
707
703
  }
708
-
709
704
  //#endregion
710
705
  //#region src/configs/unicorn.ts
711
706
  function unicorn(opts) {
@@ -742,7 +737,6 @@ function unicorn(opts) {
742
737
  }
743
738
  };
744
739
  }
745
-
746
740
  //#endregion
747
741
  //#region src/configs/react.ts
748
742
  function react(opts) {
@@ -840,7 +834,6 @@ function reactJsOnly() {
840
834
  }
841
835
  };
842
836
  }
843
-
844
837
  //#endregion
845
838
  //#region src/configs/vue.ts
846
839
  function vue(opts) {
@@ -851,7 +844,6 @@ function vue(opts) {
851
844
  rules: { ...opts.version === 3 ? pluginVue.configs["strongly-recommended"].rules : pluginVue.configs["vue2-strongly-recommended"].rules }
852
845
  };
853
846
  }
854
-
855
847
  //#endregion
856
848
  //#region src/configs/jsdoc.ts
857
849
  function jsdoc(opt) {
@@ -870,7 +862,6 @@ function jsdoc(opt) {
870
862
  }
871
863
  };
872
864
  }
873
-
874
865
  //#endregion
875
866
  //#region src/configs/lodash.ts
876
867
  function lodash() {
@@ -884,7 +875,6 @@ function lodash() {
884
875
  }
885
876
  };
886
877
  }
887
-
888
878
  //#endregion
889
879
  //#region src/configs/comments.ts
890
880
  function comments() {
@@ -906,7 +896,6 @@ function comments() {
906
896
  }
907
897
  };
908
898
  }
909
-
910
899
  //#endregion
911
900
  //#region src/configs/cspell.ts
912
901
  function cspell(opts) {
@@ -921,7 +910,6 @@ function cspell(opts) {
921
910
  }] }
922
911
  };
923
912
  }
924
-
925
913
  //#endregion
926
914
  //#region src/configs/agilebot.ts
927
915
  function agilebot(opts) {
@@ -948,10 +936,9 @@ function agilebot(opts) {
948
936
  }
949
937
  };
950
938
  }
951
-
952
939
  //#endregion
953
940
  //#region ../prettier-config/dist/index.mjs
954
- var src_default = {
941
+ const config = {
955
942
  tabWidth: 2,
956
943
  singleQuote: true,
957
944
  trailingComma: "none",
@@ -960,7 +947,6 @@ var src_default = {
960
947
  useTabs: false,
961
948
  arrowParens: "avoid"
962
949
  };
963
-
964
950
  //#endregion
965
951
  //#region src/configs/prettier.ts
966
952
  function prettier(opts) {
@@ -976,7 +962,7 @@ function prettier(opts) {
976
962
  "error",
977
963
  {
978
964
  endOfLine: "auto",
979
- ...src_default,
965
+ ...config,
980
966
  ...opts
981
967
  },
982
968
  { usePrettierrc: !opts }
@@ -984,7 +970,6 @@ function prettier(opts) {
984
970
  }
985
971
  };
986
972
  }
987
-
988
973
  //#endregion
989
974
  //#region src/configs/godaddy.ts
990
975
  function godaddy() {
@@ -1023,7 +1008,6 @@ function godaddy() {
1023
1008
  }
1024
1009
  };
1025
1010
  }
1026
-
1027
1011
  //#endregion
1028
1012
  //#region src/factory/index.ts
1029
1013
  function factory(root, options) {
@@ -1129,6 +1113,5 @@ function factory(root, options) {
1129
1113
  });
1130
1114
  return config;
1131
1115
  }
1132
-
1133
1116
  //#endregion
1134
- export { factory as agilebot };
1117
+ export { factory as agilebot };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "type": "module",
5
5
  "description": "Agilebot's ESLint config",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  "globals": "^16.2.0",
59
59
  "vue-eslint-parser": "^10.1.3",
60
60
  "yargs": "^17.7.2",
61
- "@agilebot/eslint-utils": "0.9.4"
61
+ "@agilebot/eslint-utils": "0.9.6"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/yargs": "^17.0.33",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "peerDependencies": {
68
68
  "eslint": "^9.0.0",
69
- "@agilebot/eslint-plugin": "0.9.4"
69
+ "@agilebot/eslint-plugin": "0.9.6"
70
70
  },
71
71
  "files": [
72
72
  "bin",