mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Fix lint script now that types are in types directory (#15372)
This commit is contained in:
parent
0ba0c1dd7d
commit
78f4536c66
@ -4,9 +4,11 @@ const execSync = require("child_process").execSync;
|
||||
const existsSync = require("fs").existsSync;
|
||||
const path = require("path");
|
||||
|
||||
const pkgPath = path.join("types", pkg);
|
||||
|
||||
// Path of tslint when `types-publisher` is symlinked
|
||||
const symlinkedTslintPath = "../node_modules/types-publisher/node_modules/tslint"
|
||||
let tslintPath = existsSync(path.join(pkg, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint";
|
||||
const symlinkedTslintPath = "../../node_modules/types-publisher/node_modules/tslint"
|
||||
let tslintPath = existsSync(path.join(pkgPath, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint";
|
||||
// An older version (e.g. abs/v0) is in a nested directory, so needs to look one more level up for tslint.
|
||||
if (pkg.includes("/") && pkg[pkg.length - 1] !== "/") {
|
||||
tslintPath = path.join("..", tslintPath);
|
||||
@ -17,7 +19,7 @@ console.log(cmd);
|
||||
|
||||
try {
|
||||
// Child process writes directly to our own stdout
|
||||
execSync(cmd, { cwd: pkg, stdio: "inherit" });
|
||||
execSync(cmd, { cwd: pkgPath, stdio: "inherit" });
|
||||
} catch (_) {
|
||||
// Process should have printed out error info
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
{ "extends": "./node_modules/types-publisher/tslint-definitions.json" }
|
||||
1
types/tslint.json
Normal file
1
types/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../node_modules/types-publisher/tslint-definitions.json" }
|
||||
Loading…
Reference in New Issue
Block a user