-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathindex.d.ts
More file actions
72 lines (53 loc) · 2.07 KB
/
Copy pathindex.d.ts
File metadata and controls
72 lines (53 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import {type Linter} from 'eslint';
export const tsExtensions: string[];
export const jsExtensions: string[];
export const frameworkExtensions: string[];
export const htmlExtensions: string[];
export const mdExtensions: string[];
export const allExtensions: string[];
export const tsFilesGlob: string;
export const jsFilesGlob: string;
export const allFilesGlob: string;
export const defaultIgnores: string[];
export const typescriptParser: Linter.Parser | undefined;
export type Options = {
/**
Use browser globals instead of Node.js globals.
@default false
*/
browser?: boolean;
/**
Use spaces for indentation instead of tabs.
Set to `true` for 2 spaces, or a number for a custom count.
@default false
*/
space?: boolean | number;
/**
Use semicolons at the end of statements.
@default true
*/
semicolon?: boolean;
/**
Integrate [Prettier](https://prettier.io).
- `true` — Run Prettier as an ESLint rule using XO's Prettier style, and disable the stylistic rules that would conflict with it. Requires `prettier` to be installed.
- `'compat'` — Only disable the stylistic rules that conflict with Prettier, for when you run Prettier separately (for example, from your editor or a script).
Prettier options you set in a `.prettierrc` still apply for anything XO does not configure (like `printWidth` or plugins), but XO's own style settings take precedence.
@default false
*/
prettier?: boolean | 'compat';
};
/**
ESLint shareable config for XO with support for JavaScript and TypeScript.
@returns An array of ESLint flat config objects.
*/
export default function eslintConfigXo(options?: Options): Linter.Config[];
/**
Build the ESLint flat config object that integrates [Prettier](https://prettier.io), or `undefined` when `prettier` is falsy.
Mainly intended for the `xo` package to reuse XO's Prettier integration. When `files` is omitted, the config applies to all files.
*/
export function getPrettierConfig(options: {
prettier?: boolean | 'compat';
space?: boolean | number;
semicolon?: boolean;
files?: Linter.Config['files'];
}): Linter.Config | undefined;