@xylabs/ts-scripts-yarn3 7.4.2 → 7.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/deplint/checkPackage/checkPackage.mjs +82 -89
- package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +5 -5
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +2 -2
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs +7 -10
- package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/index.mjs +82 -89
- package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
- package/dist/actions/deplint/deplint.mjs +82 -89
- package/dist/actions/deplint/deplint.mjs.map +1 -1
- package/dist/actions/deplint/findFiles.mjs +29 -14
- package/dist/actions/deplint/findFiles.mjs.map +1 -1
- package/dist/actions/deplint/findFilesByGlob.mjs +7 -2
- package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -1
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs +16 -23
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
- package/dist/actions/deplint/implicitDevDependencies.mjs +2 -2
- package/dist/actions/deplint/implicitDevDependencies.mjs.map +1 -1
- package/dist/actions/deplint/index.mjs +82 -89
- package/dist/actions/deplint/index.mjs.map +1 -1
- package/dist/actions/index.mjs +86 -93
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +82 -89
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.mjs +86 -93
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +82 -89
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +82 -89
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +82 -89
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +4 -3
package/dist/xy/index.mjs
CHANGED
|
@@ -602,33 +602,48 @@ var dead = () => {
|
|
|
602
602
|
// src/actions/deplint/deplint.ts
|
|
603
603
|
import chalk16 from "chalk";
|
|
604
604
|
|
|
605
|
+
// src/actions/deplint/findFiles.ts
|
|
606
|
+
import fs2 from "fs";
|
|
607
|
+
|
|
605
608
|
// src/actions/deplint/findFilesByGlob.ts
|
|
606
609
|
import { globSync } from "glob";
|
|
607
|
-
function findFilesByGlob(cwd, pattern) {
|
|
608
|
-
return globSync(pattern, {
|
|
610
|
+
function findFilesByGlob(cwd, pattern, ignore) {
|
|
611
|
+
return globSync(pattern, {
|
|
612
|
+
cwd,
|
|
613
|
+
absolute: true,
|
|
614
|
+
ignore,
|
|
615
|
+
nodir: true
|
|
616
|
+
});
|
|
609
617
|
}
|
|
610
618
|
|
|
611
619
|
// src/actions/deplint/findFiles.ts
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
};
|
|
620
|
+
var codeExtensions = "*.{ts,tsx,mts,cts,js,mjs,cjs}";
|
|
621
|
+
function getWorkspaceIgnores(location) {
|
|
622
|
+
try {
|
|
623
|
+
const raw = fs2.readFileSync(`${location}/package.json`, "utf8");
|
|
624
|
+
const pkg = JSON.parse(raw);
|
|
625
|
+
return pkg.workspaces ?? [];
|
|
626
|
+
} catch {
|
|
627
|
+
return [];
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
function findFiles(location) {
|
|
631
|
+
const workspaceIgnores = getWorkspaceIgnores(location).map((w) => `${w}/**`);
|
|
632
|
+
const ignore = ["**/node_modules/**", "dist/**", ...workspaceIgnores];
|
|
633
|
+
const allFiles = findFilesByGlob(location, `./**/${codeExtensions}`, ignore);
|
|
634
|
+
const distFiles = [
|
|
635
|
+
...findFilesByGlob(location, "./dist/**/*.d.ts"),
|
|
636
|
+
...findFilesByGlob(location, `./dist/**/${codeExtensions}`)
|
|
637
|
+
];
|
|
638
|
+
return { allFiles, distFiles };
|
|
624
639
|
}
|
|
625
640
|
|
|
626
641
|
// src/actions/deplint/getDependenciesFromPackageJson.ts
|
|
627
|
-
import
|
|
642
|
+
import fs3 from "fs";
|
|
628
643
|
import path3 from "path";
|
|
629
644
|
function getDependenciesFromPackageJson(packageJsonPath) {
|
|
630
645
|
const packageJsonFullPath = path3.resolve(packageJsonPath);
|
|
631
|
-
const rawContent =
|
|
646
|
+
const rawContent = fs3.readFileSync(packageJsonFullPath, "utf8");
|
|
632
647
|
const packageJson = JSON.parse(rawContent);
|
|
633
648
|
const dependencies = packageJson.dependencies ? Object.keys(packageJson.dependencies) : [];
|
|
634
649
|
const devDependencies = packageJson.devDependencies ? Object.keys(packageJson.devDependencies) : [];
|
|
@@ -641,7 +656,7 @@ function getDependenciesFromPackageJson(packageJsonPath) {
|
|
|
641
656
|
}
|
|
642
657
|
|
|
643
658
|
// src/actions/deplint/getExtendsFromTsconfigs.ts
|
|
644
|
-
import
|
|
659
|
+
import fs4 from "fs";
|
|
645
660
|
import { globSync as globSync2 } from "glob";
|
|
646
661
|
|
|
647
662
|
// src/actions/deplint/getBasePackageName.ts
|
|
@@ -666,7 +681,7 @@ function getExtendsFromTsconfigs(location) {
|
|
|
666
681
|
const packages = /* @__PURE__ */ new Set();
|
|
667
682
|
for (const file of tsconfigFiles) {
|
|
668
683
|
try {
|
|
669
|
-
const content =
|
|
684
|
+
const content = fs4.readFileSync(file, "utf8");
|
|
670
685
|
const cleaned = content.replaceAll(/\/\/.*/g, "").replaceAll(/,\s*([}\]])/g, "$1");
|
|
671
686
|
const parsed = JSON.parse(cleaned);
|
|
672
687
|
const refs = parseExtendsField(parsed.extends);
|
|
@@ -682,7 +697,7 @@ function getExtendsFromTsconfigs(location) {
|
|
|
682
697
|
}
|
|
683
698
|
|
|
684
699
|
// src/actions/deplint/getImportsFromFile.ts
|
|
685
|
-
import
|
|
700
|
+
import fs5 from "fs";
|
|
686
701
|
import path4 from "path";
|
|
687
702
|
import ts from "typescript";
|
|
688
703
|
function isTypeOnlyImportClause(clause) {
|
|
@@ -697,7 +712,7 @@ function isTypeOnlyImportClause(clause) {
|
|
|
697
712
|
return clause.isTypeOnly;
|
|
698
713
|
}
|
|
699
714
|
function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
700
|
-
const sourceCode =
|
|
715
|
+
const sourceCode = fs5.readFileSync(filePath, "utf8");
|
|
701
716
|
const isMjsFile = filePath.endsWith(".mjs");
|
|
702
717
|
const sourceFile = ts.createSourceFile(
|
|
703
718
|
path4.basename(filePath),
|
|
@@ -708,14 +723,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
708
723
|
);
|
|
709
724
|
const imports = [];
|
|
710
725
|
const typeImports = [];
|
|
711
|
-
const
|
|
726
|
+
const isDeclarationFile2 = filePath.endsWith(".d.ts");
|
|
712
727
|
function visit(node) {
|
|
713
728
|
if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
|
|
714
729
|
const moduleSpecifier = node.moduleSpecifier?.getFullText();
|
|
715
730
|
const isTypeImport = ts.isImportDeclaration(node) ? isTypeOnlyImportClause(node.importClause) : false;
|
|
716
731
|
if (typeof moduleSpecifier === "string") {
|
|
717
732
|
const trimmed = moduleSpecifier.replaceAll("'", "").replaceAll('"', "").trim();
|
|
718
|
-
if (isTypeImport ||
|
|
733
|
+
if (isTypeImport || isDeclarationFile2) {
|
|
719
734
|
typeImports.push(trimmed);
|
|
720
735
|
} else {
|
|
721
736
|
imports.push(trimmed);
|
|
@@ -750,41 +765,34 @@ var internalImportPrefixes = [".", "#", "node:"];
|
|
|
750
765
|
var removeInternalImports = (imports) => {
|
|
751
766
|
return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
|
|
752
767
|
};
|
|
768
|
+
var isDeclarationFile = (file) => file.endsWith(".d.ts") || file.endsWith(".d.cts") || file.endsWith(".d.mts");
|
|
753
769
|
function getExternalImportsFromFiles({
|
|
754
|
-
|
|
770
|
+
allFiles,
|
|
755
771
|
distFiles,
|
|
756
|
-
configFiles = [],
|
|
757
772
|
tsconfigExtends = []
|
|
758
773
|
}) {
|
|
759
|
-
const
|
|
774
|
+
const allImportPaths = {};
|
|
760
775
|
const distImportPaths = {};
|
|
761
776
|
const distTypeImportPaths = {};
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
const distTypeFiles = distFiles.filter((file) => file.endsWith(".d.ts") || file.endsWith(".d.cts") || file.endsWith(".d.mts"));
|
|
766
|
-
const distCodeFiles = distFiles.filter((file) => !(file.endsWith(".d.ts") || file.endsWith(".d.cts") || file.endsWith(".d.mts")));
|
|
777
|
+
for (const path7 of allFiles) getImportsFromFile(path7, allImportPaths, allImportPaths).flat();
|
|
778
|
+
const distTypeFiles = distFiles.filter(isDeclarationFile);
|
|
779
|
+
const distCodeFiles = distFiles.filter((file) => !isDeclarationFile(file));
|
|
767
780
|
for (const path7 of distCodeFiles) getImportsFromFile(path7, distImportPaths, distImportPaths).flat();
|
|
768
781
|
for (const path7 of distTypeFiles) getImportsFromFile(path7, distTypeImportPaths, distTypeImportPaths).flat();
|
|
769
|
-
const
|
|
782
|
+
const allImports = Object.keys(allImportPaths);
|
|
770
783
|
const distImports = Object.keys(distImportPaths);
|
|
771
|
-
const
|
|
772
|
-
const externalSrcImports = removeInternalImports(srcImports);
|
|
784
|
+
const externalAllImports = removeInternalImports(allImports);
|
|
773
785
|
const externalDistImports = removeInternalImports(distImports);
|
|
774
|
-
const externalDistTypeImports = removeInternalImports(
|
|
775
|
-
const externalConfigImports = removeInternalImports(Object.keys(configImportPaths));
|
|
786
|
+
const externalDistTypeImports = removeInternalImports(Object.keys(distTypeImportPaths));
|
|
776
787
|
for (const ext of tsconfigExtends) {
|
|
777
|
-
if (!
|
|
778
|
-
if (!externalConfigImports.includes(ext)) externalConfigImports.push(ext);
|
|
788
|
+
if (!externalAllImports.includes(ext)) externalAllImports.push(ext);
|
|
779
789
|
}
|
|
780
790
|
return {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
srcImportPaths,
|
|
784
|
-
externalConfigImports,
|
|
785
|
-
externalSrcImports,
|
|
786
|
-
distImports,
|
|
791
|
+
allImportPaths,
|
|
792
|
+
allImports,
|
|
787
793
|
distImportPaths,
|
|
794
|
+
distImports,
|
|
795
|
+
externalAllImports,
|
|
788
796
|
externalDistImports,
|
|
789
797
|
externalDistTypeImports
|
|
790
798
|
};
|
|
@@ -836,17 +844,17 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
836
844
|
dependencies,
|
|
837
845
|
peerDependencies
|
|
838
846
|
}, {
|
|
839
|
-
|
|
840
|
-
|
|
847
|
+
allImportPaths,
|
|
848
|
+
externalAllImports,
|
|
841
849
|
distImports
|
|
842
850
|
}) {
|
|
843
851
|
let unlistedDevDependencies = 0;
|
|
844
|
-
for (const imp of
|
|
852
|
+
for (const imp of externalAllImports) {
|
|
845
853
|
if (!distImports.includes(imp) && imp !== name && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
|
|
846
854
|
unlistedDevDependencies++;
|
|
847
855
|
console.log(`[${chalk12.blue(name)}] Missing devDependency in package.json: ${chalk12.red(imp)}`);
|
|
848
|
-
if (
|
|
849
|
-
console.log(` ${
|
|
856
|
+
if (allImportPaths[imp]) {
|
|
857
|
+
console.log(` ${allImportPaths[imp].join("\n ")}`);
|
|
850
858
|
}
|
|
851
859
|
}
|
|
852
860
|
}
|
|
@@ -863,13 +871,13 @@ import chalk13 from "chalk";
|
|
|
863
871
|
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
864
872
|
externalDistImports,
|
|
865
873
|
externalDistTypeImports,
|
|
866
|
-
|
|
874
|
+
externalAllImports
|
|
867
875
|
}) {
|
|
868
876
|
let unusedDependencies = 0;
|
|
869
877
|
for (const dep of dependencies) {
|
|
870
878
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
871
879
|
unusedDependencies++;
|
|
872
|
-
if (
|
|
880
|
+
if (externalAllImports.includes(dep)) {
|
|
873
881
|
console.log(`[${chalk13.blue(name)}] dependency should be devDependency in package.json: ${chalk13.red(dep)}`);
|
|
874
882
|
} else {
|
|
875
883
|
console.log(`[${chalk13.blue(name)}] Unused dependency in package.json: ${chalk13.red(dep)}`);
|
|
@@ -888,13 +896,13 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
888
896
|
import chalk14 from "chalk";
|
|
889
897
|
|
|
890
898
|
// src/actions/deplint/getRequiredPeerDependencies.ts
|
|
891
|
-
import
|
|
899
|
+
import fs6 from "fs";
|
|
892
900
|
import path5 from "path";
|
|
893
901
|
function findDepPackageJson(location, dep) {
|
|
894
902
|
let dir = location;
|
|
895
903
|
while (true) {
|
|
896
904
|
const candidate = path5.join(dir, "node_modules", dep, "package.json");
|
|
897
|
-
if (
|
|
905
|
+
if (fs6.existsSync(candidate)) return candidate;
|
|
898
906
|
const parent = path5.dirname(dir);
|
|
899
907
|
if (parent === dir) return void 0;
|
|
900
908
|
dir = parent;
|
|
@@ -906,7 +914,7 @@ function getRequiredPeerDependencies(location, allDeps) {
|
|
|
906
914
|
const depPkgPath = findDepPackageJson(location, dep);
|
|
907
915
|
if (!depPkgPath) continue;
|
|
908
916
|
try {
|
|
909
|
-
const raw =
|
|
917
|
+
const raw = fs6.readFileSync(depPkgPath, "utf8");
|
|
910
918
|
const pkg = JSON.parse(raw);
|
|
911
919
|
if (pkg.peerDependencies) {
|
|
912
920
|
for (const peer of Object.keys(pkg.peerDependencies)) {
|
|
@@ -920,13 +928,13 @@ function getRequiredPeerDependencies(location, allDeps) {
|
|
|
920
928
|
}
|
|
921
929
|
|
|
922
930
|
// src/actions/deplint/getScriptReferencedPackages.ts
|
|
923
|
-
import
|
|
931
|
+
import fs7 from "fs";
|
|
924
932
|
import path6 from "path";
|
|
925
933
|
function getBinNames(location, dep) {
|
|
926
934
|
const depPkgPath = findDepPackageJson(location, dep);
|
|
927
935
|
if (!depPkgPath) return [];
|
|
928
936
|
try {
|
|
929
|
-
const raw =
|
|
937
|
+
const raw = fs7.readFileSync(depPkgPath, "utf8");
|
|
930
938
|
const pkg = JSON.parse(raw);
|
|
931
939
|
if (!pkg.bin) return [];
|
|
932
940
|
if (typeof pkg.bin === "string") return [pkg.name?.split("/").pop() ?? dep];
|
|
@@ -942,7 +950,7 @@ function getScriptReferencedPackages(location, allDeps) {
|
|
|
942
950
|
const pkgPath = path6.join(location, "package.json");
|
|
943
951
|
let scripts = {};
|
|
944
952
|
try {
|
|
945
|
-
const raw =
|
|
953
|
+
const raw = fs7.readFileSync(pkgPath, "utf8");
|
|
946
954
|
const pkg = JSON.parse(raw);
|
|
947
955
|
scripts = pkg.scripts ?? {};
|
|
948
956
|
} catch {
|
|
@@ -972,14 +980,14 @@ function getScriptReferencedPackages(location, allDeps) {
|
|
|
972
980
|
}
|
|
973
981
|
|
|
974
982
|
// src/actions/deplint/implicitDevDependencies.ts
|
|
975
|
-
import
|
|
983
|
+
import fs8 from "fs";
|
|
976
984
|
var hasFileWithExtension = (files, extensions) => files.some((f) => extensions.some((ext) => f.endsWith(ext)));
|
|
977
985
|
var tsExtensions = [".ts", ".tsx", ".mts", ".cts"];
|
|
978
|
-
var hasTypescriptFiles = ({
|
|
986
|
+
var hasTypescriptFiles = ({ allFiles }) => hasFileWithExtension(allFiles, tsExtensions);
|
|
979
987
|
var decoratorPattern = /^\s*@[a-zA-Z]\w*/m;
|
|
980
|
-
var hasDecorators = ({
|
|
988
|
+
var hasDecorators = ({ allFiles }) => allFiles.filter((f) => tsExtensions.some((ext) => f.endsWith(ext))).some((file) => {
|
|
981
989
|
try {
|
|
982
|
-
const content =
|
|
990
|
+
const content = fs8.readFileSync(file, "utf8");
|
|
983
991
|
return decoratorPattern.test(content);
|
|
984
992
|
} catch {
|
|
985
993
|
return false;
|
|
@@ -992,7 +1000,7 @@ function hasImportPlugin({ location, allDependencies }) {
|
|
|
992
1000
|
const pkgPath = findDepPackageJson(location, dep);
|
|
993
1001
|
if (!pkgPath) continue;
|
|
994
1002
|
try {
|
|
995
|
-
const pkg = JSON.parse(
|
|
1003
|
+
const pkg = JSON.parse(fs8.readFileSync(pkgPath, "utf8"));
|
|
996
1004
|
const transitiveDeps = [
|
|
997
1005
|
...Object.keys(pkg.dependencies ?? {}),
|
|
998
1006
|
...Object.keys(pkg.peerDependencies ?? {})
|
|
@@ -1029,18 +1037,15 @@ function getImplicitDevDependencies(context) {
|
|
|
1029
1037
|
|
|
1030
1038
|
// src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
|
|
1031
1039
|
var allExternalImports = ({
|
|
1032
|
-
|
|
1040
|
+
externalAllImports,
|
|
1033
1041
|
externalDistImports,
|
|
1034
|
-
externalDistTypeImports
|
|
1035
|
-
externalConfigImports
|
|
1042
|
+
externalDistTypeImports
|
|
1036
1043
|
}) => {
|
|
1037
|
-
|
|
1038
|
-
...
|
|
1044
|
+
return /* @__PURE__ */ new Set([
|
|
1045
|
+
...externalAllImports,
|
|
1039
1046
|
...externalDistImports,
|
|
1040
|
-
...externalDistTypeImports
|
|
1041
|
-
...externalConfigImports
|
|
1047
|
+
...externalDistTypeImports
|
|
1042
1048
|
]);
|
|
1043
|
-
return all;
|
|
1044
1049
|
};
|
|
1045
1050
|
function isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs) {
|
|
1046
1051
|
if (implicitDeps.has(dep)) return true;
|
|
@@ -1105,18 +1110,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
|
|
|
1105
1110
|
}
|
|
1106
1111
|
|
|
1107
1112
|
// src/actions/deplint/checkPackage/checkPackage.ts
|
|
1108
|
-
function logVerbose(name, location,
|
|
1113
|
+
function logVerbose(name, location, allFiles, distFiles, tsconfigExtends) {
|
|
1109
1114
|
console.info(`Checking package: ${name} at ${location}`);
|
|
1110
|
-
console.info(`
|
|
1111
|
-
for (const file of
|
|
1112
|
-
console.info(`
|
|
1115
|
+
console.info(`All files: ${allFiles.length}, Distribution files: ${distFiles.length}`);
|
|
1116
|
+
for (const file of allFiles) {
|
|
1117
|
+
console.info(`File: ${file}`);
|
|
1113
1118
|
}
|
|
1114
1119
|
for (const file of distFiles) {
|
|
1115
1120
|
console.info(`Distribution file: ${file}`);
|
|
1116
1121
|
}
|
|
1117
|
-
for (const file of configFiles) {
|
|
1118
|
-
console.info(`Config file: ${file}`);
|
|
1119
|
-
}
|
|
1120
1122
|
for (const ext of tsconfigExtends) {
|
|
1121
1123
|
console.info(`Tsconfig extends: ${ext}`);
|
|
1122
1124
|
}
|
|
@@ -1129,33 +1131,24 @@ function checkPackage({
|
|
|
1129
1131
|
peerDeps = false,
|
|
1130
1132
|
verbose = false
|
|
1131
1133
|
}) {
|
|
1132
|
-
const {
|
|
1133
|
-
srcFiles,
|
|
1134
|
-
distFiles,
|
|
1135
|
-
configFiles
|
|
1136
|
-
} = findFiles(location);
|
|
1134
|
+
const { allFiles, distFiles } = findFiles(location);
|
|
1137
1135
|
const tsconfigExtends = getExtendsFromTsconfigs(location);
|
|
1138
1136
|
if (verbose) {
|
|
1139
|
-
logVerbose(name, location,
|
|
1137
|
+
logVerbose(name, location, allFiles, distFiles, tsconfigExtends);
|
|
1140
1138
|
}
|
|
1141
1139
|
const checkDeps = deps || !(deps || devDeps || peerDeps);
|
|
1142
1140
|
const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
|
|
1143
1141
|
const checkPeerDeps = peerDeps;
|
|
1144
1142
|
const sourceParams = getExternalImportsFromFiles({
|
|
1145
|
-
|
|
1143
|
+
allFiles,
|
|
1146
1144
|
distFiles,
|
|
1147
|
-
configFiles,
|
|
1148
1145
|
tsconfigExtends
|
|
1149
1146
|
});
|
|
1150
1147
|
const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
|
|
1151
1148
|
const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1152
1149
|
const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1153
1150
|
const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1154
|
-
const fileContext = {
|
|
1155
|
-
configFiles,
|
|
1156
|
-
distFiles,
|
|
1157
|
-
srcFiles
|
|
1158
|
-
};
|
|
1151
|
+
const fileContext = { allFiles, distFiles };
|
|
1159
1152
|
const unusedDevDependencies = checkDevDeps ? getUnusedDevDependencies({ name, location }, packageParams, sourceParams, fileContext) : 0;
|
|
1160
1153
|
const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1161
1154
|
const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + unusedDevDependencies + unusedPeerDependencies;
|