@forge/lint 3.5.3-next.2 → 3.6.0-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @forge/lint
2
2
 
3
+ ## 3.6.0-next.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 8467b94a: CLI Lint error handling
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [8467b94a]
12
+ - @forge/cli-shared@3.15.0-next.3
13
+
3
14
  ## 3.5.3-next.2
4
15
 
5
16
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAUxG,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,WAAY,UAAU,eAAe,UAAU,EAAE,4BAAuB,IA+CrG,CAAC;AAEF,eAAO,MAAM,YAAY,gBAAiB,UAAU,EAAE,KAAG,YAQxD,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBACF,MAAM,EAAE,YACX,QAAQ,eACL,MAAM,UACX,UAAU,6BAhBR,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAAC,YAeV,eAAe,EAAE,KASzB,QAAQ,UAAU,EAAE,CAmCtB,CAAC;AAEF,eAAO,MAAM,QAAQ,WACX,UAAU,WACV,eAAe,KACtB,QAAQ,UAAU,EAAE,CAGtB,CAAC"}
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAUxG,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,WAAY,UAAU,eAAe,UAAU,EAAE,4BAAuB,IA+CrG,CAAC;AAEF,eAAO,MAAM,YAAY,gBAAiB,UAAU,EAAE,KAAG,YAQxD,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBACF,MAAM,EAAE,YACX,QAAQ,eACL,MAAM,UACX,UAAU,6BAhBR,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAAC,YAeV,eAAe,EAAE,KASzB,QAAQ,UAAU,EAAE,CAyCtB,CAAC;AAEF,eAAO,MAAM,QAAQ,WACX,UAAU,WACV,eAAe,KACtB,QAAQ,UAAU,EAAE,CAGtB,CAAC"}
package/out/lint/lint.js CHANGED
@@ -88,29 +88,34 @@ const lint = async (filesToLint, manifest, environment, logger, parseFunction =
88
88
  const { include, exclude } = await (0, cli_shared_1.listTSConfigIncludeExclude)(new cli_shared_1.FileSystemReader());
89
89
  const tsInclude = new Set(include);
90
90
  const tsExclude = new Set(exclude);
91
- const lintInputs = (await Promise.all(filesToLint.map(async (filepath) => {
92
- const ext = path_1.default.extname(filepath);
93
- if (ext.match(/jsx?$/)) {
94
- return parseFunction(filepath, parse_1.tsParser);
95
- }
96
- else if (ext.match(/tsx?$/)) {
97
- const resolvedFilePath = path_1.default.resolve('./' + filepath);
98
- const tsFileIncluded = tsInclude.has(resolvedFilePath);
99
- const tsFileExcluded = tsExclude.has(resolvedFilePath);
100
- if ((tsFileIncluded && !tsFileExcluded) || (!tsInclude.size && !tsExclude.size)) {
91
+ try {
92
+ const lintInputs = (await Promise.all(filesToLint.map(async (filepath) => {
93
+ const ext = path_1.default.extname(filepath);
94
+ if (ext.match(/jsx?$/)) {
101
95
  return parseFunction(filepath, parse_1.tsParser);
102
96
  }
103
- }
104
- return { ast: null, filepath: '' };
105
- }))).filter((result) => !!(result === null || result === void 0 ? void 0 : result.ast));
106
- await Promise.all(linters.map((linter) => linter.bootstrap()));
107
- const results = await Promise.all(linters.map((linter) => linter.batchExecute(lintInputs))).then(cli_shared_1.flat);
108
- return results.map((result) => {
109
- const comparator = (a, b) => a.line === b.line ? a.column - b.column : a.line - b.line;
110
- result.errors = result.errors.sort(comparator);
111
- result.warnings = result.warnings.sort(comparator);
112
- return result;
113
- });
97
+ else if (ext.match(/tsx?$/)) {
98
+ const resolvedFilePath = path_1.default.resolve('./' + filepath);
99
+ const tsFileIncluded = tsInclude.has(resolvedFilePath);
100
+ const tsFileExcluded = tsExclude.has(resolvedFilePath);
101
+ if ((tsFileIncluded && !tsFileExcluded) || (!tsInclude.size && !tsExclude.size)) {
102
+ return parseFunction(filepath, parse_1.tsParser);
103
+ }
104
+ }
105
+ return { ast: null, filepath: '' };
106
+ }))).filter((result) => !!(result === null || result === void 0 ? void 0 : result.ast));
107
+ await Promise.all(linters.map((linter) => linter.bootstrap()));
108
+ const results = await Promise.all(linters.map((linter) => linter.batchExecute(lintInputs))).then(cli_shared_1.flat);
109
+ return results.map((result) => {
110
+ const comparator = (a, b) => a.line === b.line ? a.column - b.column : a.line - b.line;
111
+ result.errors = result.errors.sort(comparator);
112
+ result.warnings = result.warnings.sort(comparator);
113
+ return result;
114
+ });
115
+ }
116
+ catch (e) {
117
+ throw new cli_shared_1.ApplicationCompileError(e);
118
+ }
114
119
  };
115
120
  exports.lint = lint;
116
121
  const litelint = async (logger, linter = new basic_manifest_linter_1.BasicManifestLinter(logger)) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/lint",
3
- "version": "3.5.3-next.2",
3
+ "version": "3.6.0-next.3",
4
4
  "description": "Linting for forge apps",
5
5
  "main": "out/index.js",
6
6
  "license": "UNLICENSED",
@@ -17,7 +17,7 @@
17
17
  "@types/node-fetch": "^2.6.4"
18
18
  },
19
19
  "dependencies": {
20
- "@forge/cli-shared": "3.14.1-next.2",
20
+ "@forge/cli-shared": "3.15.0-next.3",
21
21
  "@forge/egress": "1.2.1",
22
22
  "@forge/manifest": "4.15.1-next.2",
23
23
  "@typescript-eslint/typescript-estree": "^5.40.0",