Bump the npm group with 2 updates (#2045)
* Bump the npm group with 2 updates Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import). Updates `eslint` from 8.55.0 to 8.56.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0) Updates `eslint-plugin-import` from 2.29.0 to 2.29.1 - [Release notes](https://github.com/import-js/eslint-plugin-import/releases) - [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md) - [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: eslint-plugin-import dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
511f073971
commit
144b7d5b16
32 changed files with 618 additions and 251 deletions
94
node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js
generated
vendored
94
node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js
generated
vendored
|
|
@ -112,25 +112,30 @@ describe("walkForTsConfig", function () {
|
|||
});
|
||||
});
|
||||
describe("loadConfig", function () {
|
||||
it("It should load a config", function () {
|
||||
it("should load a config", function () {
|
||||
var config = { compilerOptions: { baseUrl: "hej" } };
|
||||
var res = (0, tsconfig_loader_1.loadTsconfig)("/root/dir1/tsconfig.json", function (path) { return path === "/root/dir1/tsconfig.json"; }, function (_) { return JSON.stringify(config); });
|
||||
// assert.deepEqual(res, config);
|
||||
expect(res).toStrictEqual(config);
|
||||
});
|
||||
it("It should load a config with comments", function () {
|
||||
it("should load a config with comments", function () {
|
||||
var config = { compilerOptions: { baseUrl: "hej" } };
|
||||
var res = (0, tsconfig_loader_1.loadTsconfig)("/root/dir1/tsconfig.json", function (path) { return path === "/root/dir1/tsconfig.json"; }, function (_) { return "{\n // my comment\n \"compilerOptions\": { \n \"baseUrl\": \"hej\"\n }\n }"; });
|
||||
// assert.deepEqual(res, config);
|
||||
expect(res).toStrictEqual(config);
|
||||
});
|
||||
it("It should load a config with trailing commas", function () {
|
||||
it("should load a config with trailing commas", function () {
|
||||
var config = { compilerOptions: { baseUrl: "hej" } };
|
||||
var res = (0, tsconfig_loader_1.loadTsconfig)("/root/dir1/tsconfig.json", function (path) { return path === "/root/dir1/tsconfig.json"; }, function (_) { return "{\n \"compilerOptions\": { \n \"baseUrl\": \"hej\",\n },\n }"; });
|
||||
// assert.deepEqual(res, config);
|
||||
expect(res).toStrictEqual(config);
|
||||
});
|
||||
it("It should load a config with extends and overwrite all options", function () {
|
||||
it("should throw an error including the file path when encountering invalid JSON5", function () {
|
||||
expect(function () {
|
||||
return (0, tsconfig_loader_1.loadTsconfig)("/root/dir1/tsconfig.json", function (path) { return path === "/root/dir1/tsconfig.json"; }, function (_) { return "{\n \"compilerOptions\": {\n }"; });
|
||||
}).toThrowError("/root/dir1/tsconfig.json is malformed JSON5: invalid end of input at 3:12");
|
||||
});
|
||||
it("should load a config with string extends and overwrite all options", function () {
|
||||
var firstConfig = {
|
||||
extends: "../base-config.json",
|
||||
compilerOptions: { baseUrl: "kalle", paths: { foo: ["bar2"] } },
|
||||
|
|
@ -170,7 +175,7 @@ describe("loadConfig", function () {
|
|||
},
|
||||
});
|
||||
});
|
||||
it("It should load a config with extends from node_modules and overwrite all options", function () {
|
||||
it("should load a config with string extends from node_modules and overwrite all options", function () {
|
||||
var firstConfig = {
|
||||
extends: "my-package/base-config.json",
|
||||
compilerOptions: { baseUrl: "kalle", paths: { foo: ["bar2"] } },
|
||||
|
|
@ -210,7 +215,7 @@ describe("loadConfig", function () {
|
|||
},
|
||||
});
|
||||
});
|
||||
it("Should use baseUrl relative to location of extended tsconfig", function () {
|
||||
it("should use baseUrl relative to location of extended tsconfig", function () {
|
||||
var firstConfig = { compilerOptions: { baseUrl: "." } };
|
||||
var firstConfigPath = (0, path_1.join)("/root", "first-config.json");
|
||||
var secondConfig = { extends: "../first-config.json" };
|
||||
|
|
@ -242,5 +247,82 @@ describe("loadConfig", function () {
|
|||
compilerOptions: { baseUrl: (0, path_1.join)("..", "..") },
|
||||
});
|
||||
});
|
||||
it("should load a config with array extends and overwrite all options", function () {
|
||||
var baseConfig1 = {
|
||||
compilerOptions: { baseUrl: ".", paths: { foo: ["bar"] } },
|
||||
};
|
||||
var baseConfig1Path = (0, path_1.join)("/root", "base-config-1.json");
|
||||
var baseConfig2 = { compilerOptions: { baseUrl: "." } };
|
||||
var baseConfig2Path = (0, path_1.join)("/root", "dir1", "base-config-2.json");
|
||||
var baseConfig3 = {
|
||||
compilerOptions: { baseUrl: ".", paths: { foo: ["bar2"] } },
|
||||
};
|
||||
var baseConfig3Path = (0, path_1.join)("/root", "dir1", "dir2", "base-config-3.json");
|
||||
var actualConfig = {
|
||||
extends: [
|
||||
"./base-config-1.json",
|
||||
"./dir1/base-config-2.json",
|
||||
"./dir1/dir2/base-config-3.json",
|
||||
],
|
||||
};
|
||||
var actualConfigPath = (0, path_1.join)("/root", "tsconfig.json");
|
||||
var res = (0, tsconfig_loader_1.loadTsconfig)((0, path_1.join)("/root", "tsconfig.json"), function (path) {
|
||||
return [
|
||||
baseConfig1Path,
|
||||
baseConfig2Path,
|
||||
baseConfig3Path,
|
||||
actualConfigPath,
|
||||
].indexOf(path) >= 0;
|
||||
}, function (path) {
|
||||
if (path === baseConfig1Path) {
|
||||
return JSON.stringify(baseConfig1);
|
||||
}
|
||||
if (path === baseConfig2Path) {
|
||||
return JSON.stringify(baseConfig2);
|
||||
}
|
||||
if (path === baseConfig3Path) {
|
||||
return JSON.stringify(baseConfig3);
|
||||
}
|
||||
if (path === actualConfigPath) {
|
||||
return JSON.stringify(actualConfig);
|
||||
}
|
||||
return "";
|
||||
});
|
||||
expect(res).toEqual({
|
||||
extends: [
|
||||
"./base-config-1.json",
|
||||
"./dir1/base-config-2.json",
|
||||
"./dir1/dir2/base-config-3.json",
|
||||
],
|
||||
compilerOptions: {
|
||||
baseUrl: (0, path_1.join)("dir1", "dir2"),
|
||||
paths: { foo: ["bar2"] },
|
||||
},
|
||||
});
|
||||
});
|
||||
it("should load a config with array extends without .json extension", function () {
|
||||
var baseConfig = {
|
||||
compilerOptions: { baseUrl: ".", paths: { foo: ["bar"] } },
|
||||
};
|
||||
var baseConfigPath = (0, path_1.join)("/root", "base-config-1.json");
|
||||
var actualConfig = { extends: ["./base-config-1"] };
|
||||
var actualConfigPath = (0, path_1.join)("/root", "tsconfig.json");
|
||||
var res = (0, tsconfig_loader_1.loadTsconfig)((0, path_1.join)("/root", "tsconfig.json"), function (path) { return [baseConfigPath, actualConfigPath].indexOf(path) >= 0; }, function (path) {
|
||||
if (path === baseConfigPath) {
|
||||
return JSON.stringify(baseConfig);
|
||||
}
|
||||
if (path === actualConfigPath) {
|
||||
return JSON.stringify(actualConfig);
|
||||
}
|
||||
return "";
|
||||
});
|
||||
expect(res).toEqual({
|
||||
extends: ["./base-config-1"],
|
||||
compilerOptions: {
|
||||
baseUrl: ".",
|
||||
paths: { foo: ["bar"] },
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=tsconfig-loader.test.js.map
|
||||
2
node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js.map
generated
vendored
2
node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue