UNPKG

2.5 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2013 Palantir Technologies, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17export interface Options {
18 /**
19 * Path to a configuration file.
20 */
21 config?: string;
22 /**
23 * Exclude globs from path expansion.
24 */
25 exclude: string[];
26 /**
27 * File paths to lint.
28 */
29 files: string[];
30 /**
31 * Whether to return status code 0 even if there are lint errors.
32 */
33 force?: boolean;
34 /**
35 * Whether to fixes linting errors for select rules. This may overwrite linted files.
36 */
37 fix?: boolean;
38 /**
39 * Output format.
40 */
41 format?: string;
42 /**
43 * Formatters directory path.
44 */
45 formattersDirectory?: string;
46 /**
47 * Whether to generate a tslint.json config file in the current working directory.
48 */
49 init?: boolean;
50 /**
51 * Output file path.
52 */
53 out?: string;
54 /**
55 * Whether to output absolute paths
56 */
57 outputAbsolutePaths?: boolean;
58 /**
59 * Outputs the configuration to be used instead of linting.
60 */
61 printConfig?: boolean;
62 /**
63 * tsconfig.json file.
64 */
65 project?: string;
66 /**
67 * Whether to hide warnings
68 */
69 quiet?: boolean;
70 /**
71 * Rules directory paths.
72 */
73 rulesDirectory?: string | string[];
74 /**
75 * Run the tests in the given directories to ensure a (custom) TSLint rule's output matches the expected output.
76 * When this property is `true` the `files` property is used to specify the directories from which the tests should be executed.
77 */
78 test?: boolean;
79 /**
80 * Whether to enable type checking when linting a project.
81 */
82 typeCheck?: boolean;
83}
84export declare const enum Status {
85 Ok = 0,
86 FatalError = 1,
87 LintError = 2
88}
89export interface Logger {
90 log(message: string): void;
91 error(message: string): void;
92}
93export declare function run(options: Options, logger: Logger): Promise<Status>;