1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const path = require("path");
|
4 | const locate_1 = require("../../core/locate");
|
5 | const project_config_1 = require("../../project-config");
|
6 | function getDefaultConfigPath() {
|
7 | return locate_1.locateFile("tslint.json", __dirname);
|
8 | }
|
9 | function createTsLintConfig(options) {
|
10 | const config = project_config_1.ProjectConfig.loadFromFile(options.path);
|
11 | const customConfigPath = locate_1.locateFile("tslint.json", config.paths.projectRoot, false);
|
12 | const lintConfigPath = customConfigPath || getDefaultConfigPath();
|
13 | return {
|
14 | config: lintConfigPath,
|
15 | exclude: ["node_modules/**"],
|
16 | files: [path.resolve(config.paths.projectWorkingDirectory, "./**/*.ts?(x)")],
|
17 | fix: options.fix,
|
18 | force: options.force,
|
19 | format: "stylish",
|
20 | project: config.paths.projectTsConfig,
|
21 | };
|
22 | }
|
23 | exports.createTsLintConfig = createTsLintConfig;
|