@forge/lint 3.3.2-next.2 → 3.4.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 +6 -0
- package/out/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.d.ts +1 -0
- package/out/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.d.ts.map +1 -1
- package/out/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,7 @@ import { TSESTree } from '@typescript-eslint/typescript-estree';
|
|
|
4
4
|
export declare abstract class AbstractIconVisitor implements NodeVisitor<DynamicPropertiesIconUrl> {
|
|
5
5
|
visit(node: TSESTree.Node, parent: TSESTree.Node | undefined, callback: (input: DynamicPropertiesIconUrl) => void): void;
|
|
6
6
|
protected abstract getIconDefinitionNode(node: any): any;
|
|
7
|
+
private isBundledUri;
|
|
7
8
|
private handleIconNode;
|
|
8
9
|
private transformArgsToIconUrl;
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-icon-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhF,8BAAsB,mBAAoB,YAAW,WAAW,CAAC,wBAAwB,CAAC;IACxF,KAAK,CACH,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,GAClD,IAAI;IAkBP,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAExD,OAAO,CAAC,cAAc,CAOpB;IAEF,OAAO,CAAC,sBAAsB,CAK3B;CACJ"}
|
|
1
|
+
{"version":3,"file":"abstract-icon-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhF,8BAAsB,mBAAoB,YAAW,WAAW,CAAC,wBAAwB,CAAC;IACxF,KAAK,CACH,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,GAClD,IAAI;IAkBP,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAExD,OAAO,CAAC,YAAY,CACkD;IAEtE,OAAO,CAAC,cAAc,CAOpB;IAEF,OAAO,CAAC,sBAAsB,CAK3B;CACJ"}
|
|
@@ -4,9 +4,10 @@ exports.AbstractIconVisitor = void 0;
|
|
|
4
4
|
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
|
|
5
5
|
class AbstractIconVisitor {
|
|
6
6
|
constructor() {
|
|
7
|
+
this.isBundledUri = (iconUri) => iconUri.startsWith('resource:') || iconUri.startsWith('data:image');
|
|
7
8
|
this.handleIconNode = (iconNode, callback) => {
|
|
8
9
|
if ((iconNode === null || iconNode === void 0 ? void 0 : iconNode.type) === typescript_estree_1.AST_NODE_TYPES.Literal && typeof (iconNode === null || iconNode === void 0 ? void 0 : iconNode.value) === 'string') {
|
|
9
|
-
if (iconNode.value.trim() !== '' && !iconNode.value.trim()
|
|
10
|
+
if (iconNode.value.trim() !== '' && !this.isBundledUri(iconNode.value.trim())) {
|
|
10
11
|
const iconUrl = this.transformArgsToIconUrl(iconNode);
|
|
11
12
|
callback(iconUrl);
|
|
12
13
|
}
|