Update ESLint and plugin packages

R=jacktfranklin@chromium.org

Bug: none
Change-Id: If1b2420ba6e1c100c3d6b2013815ff1a555ea987
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3369367
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
This commit is contained in:
Tim van der Lippe
2022-01-06 15:06:40 +00:00
committed by Devtools-frontend LUCI CQ
parent 92b451ffb1
commit 0ceb465d1c
480 changed files with 3299 additions and 2655 deletions
+4
View File
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
## [3.12.0] - 2021-08-24
- Add support for baseUrl override using TS_NODE_BASEURL env var #185 and #114. Thanks to @ejhayes and @information-security for these PRs!
## [3.11.0] - 2021-08-24
- Reverted upgrade of json5 due to being a breaking change. See PR #173.
+6
View File
@@ -30,6 +30,10 @@ npm install --save-dev tsconfig-paths
`node -r tsconfig-paths/register main.js`
If `process.env.TS_NODE_BASEURL` is set it will override the value of `baseUrl` in tsconfig.json:
`TS_NODE_BASEURL=./dist node -r tsconfig-paths/register main.js`
### With ts-node
`ts-node -r tsconfig-paths/register main.ts`
@@ -87,6 +91,8 @@ The following is an example configuration for the `.vscode/launch.json`.
If you want more granular control over tsconfig-paths you can bootstrap it. This can be useful if you for instance have compiled with `tsc` to another directory where `tsconfig.json` doesn't exists.
For example, create a wrapper script called `tsconfig-paths-bootstrap.js` with the contents below:
```javascript
const tsConfig = require("./tsconfig.json");
const tsConfigPaths = require("tsconfig-paths");
+1 -1
View File
@@ -21,7 +21,7 @@ export interface TsConfigLoaderResult {
export interface TsConfigLoaderParams {
getEnv: (key: string) => string | undefined;
cwd: string;
loadSync?(cwd: string, filename?: string): TsConfigLoaderResult;
loadSync?(cwd: string, filename?: string, baseUrl?: string): TsConfigLoaderResult;
}
export declare function tsConfigLoader({ getEnv, cwd, loadSync, }: TsConfigLoaderParams): TsConfigLoaderResult;
export declare function walkForTsConfig(directory: string, existsSync?: (path: string) => boolean): string | undefined;
+6 -3
View File
@@ -16,12 +16,14 @@ var StripBom = require("strip-bom");
function tsConfigLoader(_a) {
var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b;
var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT");
var TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL");
// tsconfig.loadSync handles if TS_NODE_PROJECT is a file or directory
var loadResult = loadSync(cwd, TS_NODE_PROJECT);
// and also overrides baseURL if TS_NODE_BASEURL is available.
var loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
return loadResult;
}
exports.tsConfigLoader = tsConfigLoader;
function loadSyncDefault(cwd, filename) {
function loadSyncDefault(cwd, filename, baseUrl) {
// Tsconfig.loadSync uses path.resolve. This is why we can use an absolute path as filename
var configPath = resolveConfigPath(cwd, filename);
if (!configPath) {
@@ -34,7 +36,8 @@ function loadSyncDefault(cwd, filename) {
var config = loadTsconfig(configPath);
return {
tsConfigPath: configPath,
baseUrl: config && config.compilerOptions && config.compilerOptions.baseUrl,
baseUrl: baseUrl ||
(config && config.compilerOptions && config.compilerOptions.baseUrl),
paths: config && config.compilerOptions && config.compilerOptions.paths,
};
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "tsconfig-paths",
"version": "3.11.0",
"version": "3.12.0",
"description": "Load node modules according to tsconfig paths, in run-time or via API.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
+16 -4
View File
@@ -26,7 +26,11 @@ export interface TsConfigLoaderResult {
export interface TsConfigLoaderParams {
getEnv: (key: string) => string | undefined;
cwd: string;
loadSync?(cwd: string, filename?: string): TsConfigLoaderResult;
loadSync?(
cwd: string,
filename?: string,
baseUrl?: string
): TsConfigLoaderResult;
}
export function tsConfigLoader({
@@ -35,13 +39,19 @@ export function tsConfigLoader({
loadSync = loadSyncDefault,
}: TsConfigLoaderParams): TsConfigLoaderResult {
const TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT");
const TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL");
// tsconfig.loadSync handles if TS_NODE_PROJECT is a file or directory
const loadResult = loadSync(cwd, TS_NODE_PROJECT);
// and also overrides baseURL if TS_NODE_BASEURL is available.
const loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
return loadResult;
}
function loadSyncDefault(cwd: string, filename?: string): TsConfigLoaderResult {
function loadSyncDefault(
cwd: string,
filename?: string,
baseUrl?: string
): TsConfigLoaderResult {
// Tsconfig.loadSync uses path.resolve. This is why we can use an absolute path as filename
const configPath = resolveConfigPath(cwd, filename);
@@ -57,7 +67,9 @@ function loadSyncDefault(cwd: string, filename?: string): TsConfigLoaderResult {
return {
tsConfigPath: configPath,
baseUrl: config && config.compilerOptions && config.compilerOptions.baseUrl,
baseUrl:
baseUrl ||
(config && config.compilerOptions && config.compilerOptions.baseUrl),
paths: config && config.compilerOptions && config.compilerOptions.paths,
};
}