MCPcopy
hub / github.com/benjamn/recast / Options

Interface Options

lib/options.ts:7–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 * documented in options.js
6 */
7export interface Options extends DeprecatedOptions {
8 /**
9 * If you want to use a different branch of esprima, or any other module
10 * that supports a .parse function, pass that module object to
11 * recast.parse as options.parser (legacy synonym: options.esprima).
12 * @default require("recast/parsers/esprima")
13 */
14 parser?: any;
15
16 /**
17 * Number of spaces the pretty-printer should use per tab for
18 * indentation. If you do not pass this option explicitly, it will be
19 * (quite reliably!) inferred from the original code.
20 * @default 4
21 */
22 tabWidth?: number;
23
24 /**
25 * If you really want the pretty-printer to use tabs instead of spaces,
26 * make this option true.
27 * @default false
28 */
29 useTabs?: boolean;
30
31 /**
32 * The reprinting code leaves leading whitespace untouched unless it has
33 * to reindent a line, or you pass false for this option.
34 * @default true
35 */
36 reuseWhitespace?: boolean;
37
38 /**
39 * Override this option to use a different line terminator, e.g. \r\n.
40 * @default require("os").EOL || "\n"
41 */
42 lineTerminator?: string;
43
44 /**
45 * Some of the pretty-printer code (such as that for printing function
46 * parameter lists) makes a valiant attempt to prevent really long
47 * lines. You can adjust the limit by changing this option; however,
48 * there is no guarantee that line length will fit inside this limit.
49 * @default 74
50 */
51 wrapColumn?: number;
52
53 /**
54 * Pass a string as options.sourceFileName to recast.parse to tell the
55 * reprinter to keep track of reused code so that it can construct a
56 * source map automatically.
57 * @default null
58 */
59 sourceFileName?: string | null;
60
61 /**
62 * Pass a string as options.sourceMapName to recast.print, and (provided
63 * you passed options.sourceFileName earlier) the PrintResult of
64 * recast.print will have a .map property for the generated source map.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…