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