@xylabs/ts-scripts-yarn3 5.1.1 → 5.1.2

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.
@@ -1148,36 +1148,40 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1148
1148
  }
1149
1149
  }
1150
1150
  }, "dumpMessages");
1151
- var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1151
+ var lintPackage = /* @__PURE__ */ __name(async ({ pkg, fix: fix2 }) => {
1152
1152
  const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
1153
1153
  if (!workspace) {
1154
1154
  console.error(chalk17.red(`Unable to locate package [${chalk17.magenta(pkg)}]`));
1155
1155
  process.exit(1);
1156
1156
  }
1157
1157
  const engine = new ESLint2({
1158
- cache: true
1158
+ cache: true,
1159
+ fix: fix2
1159
1160
  });
1160
1161
  const lintResults = await engine.lintFiles(workspace.location);
1161
1162
  dumpMessages(lintResults);
1162
1163
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1163
1164
  }, "lintPackage");
1164
- var lintAll = /* @__PURE__ */ __name(async () => {
1165
- const engine = new ESLint2({
1166
- cache: true
1167
- });
1168
- const lintResults = await engine.lintFiles("./**/*.*");
1169
- dumpMessages(lintResults);
1170
- return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1165
+ var lintAll = /* @__PURE__ */ __name(async ({ fix: fix2 }) => {
1166
+ const workspace = yarnWorkspaces();
1167
+ for (const ws of workspace) {
1168
+ await lintPackage({
1169
+ pkg: ws.name,
1170
+ fix: fix2
1171
+ });
1172
+ }
1171
1173
  }, "lintAll");
1172
- var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental } = {}) => {
1174
+ var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental, fix: fix2 } = {}) => {
1173
1175
  return pkg ? await lintPackage({
1174
- pkg
1176
+ pkg,
1177
+ fix: fix2
1175
1178
  }) : lintAllPackages({
1176
1179
  verbose,
1177
- incremental
1180
+ incremental,
1181
+ fix: fix2
1178
1182
  });
1179
1183
  }, "lint");
1180
- var lintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
1184
+ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incremental } = {}) => {
1181
1185
  console.log(chalk17.gray("Linting [All-Packages]"));
1182
1186
  const start = Date.now();
1183
1187
  const verboseOptions = verbose ? [
@@ -1185,6 +1189,11 @@ var lintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } =
1185
1189
  ] : [
1186
1190
  "--no-verbose"
1187
1191
  ];
1192
+ const fixOptions = fix2 ? [
1193
+ "--fix"
1194
+ ] : [
1195
+ ""
1196
+ ];
1188
1197
  const incrementalOptions = incremental ? [
1189
1198
  "--since",
1190
1199
  "-Apt"
@@ -1201,7 +1210,8 @@ var lintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } =
1201
1210
  ...verboseOptions,
1202
1211
  ...incrementalOptions,
1203
1212
  "run",
1204
- "package-lint"
1213
+ "package-lint",
1214
+ ...fixOptions
1205
1215
  ]
1206
1216
  ]
1207
1217
  ]);