UNPKG

949 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const path = require("path");
4const locate_1 = require("../../core/locate");
5const project_config_1 = require("../../project-config");
6function getDefaultConfigPath() {
7 return locate_1.locateFile("tslint.json", __dirname);
8}
9function 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}
23exports.createTsLintConfig = createTsLintConfig;