@forge/lint 5.3.5-next.1 → 5.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @forge/lint
2
2
 
3
+ ## 5.4.0-next.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 3b3f1f8: No longer lint the removed Properties API
8
+
9
+ ## 5.3.5-next.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [65bb6b7]
14
+ - @forge/manifest@7.7.2-next.0
15
+ - @forge/cli-shared@5.5.2-next.2
16
+
3
17
  ## 5.3.5-next.1
4
18
 
5
19
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAE/E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,OAAO,EAEP,eAAe,EACf,QAAQ,EACR,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAOL,WAAW,EAGZ,MAAM,aAAa,CAAC;AAWrB,UAAU,aAAa;IACrB,KAAK,EAAE;QACL,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;KAC7B,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAKhD,eAAO,MAAM,sBAAsB,WACzB,cAAc,EAAE,YACd,cAAc,EAAE,mBAEtB,mBAAmB,GACnB,gCAAgC,GAChC,+BAA+B,GAC/B,iCAAiC,UAC7B,YAAY,KACnB,IAAI,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,cA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AAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAyB3D,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAWtE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrE,OAAO,CAAC,YAAY;CAarB"}
1
+ {"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAE/E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,OAAO,EAEP,eAAe,EACf,QAAQ,EACR,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,WAAW,EAGZ,MAAM,aAAa,CAAC;AAUrB,UAAU,aAAa;IACrB,KAAK,EAAE;QACL,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;KAC7B,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAKhD,eAAO,MAAM,sBAAsB,WACzB,cAAc,EAAE,YACd,cAAc,EAAE,mBAEtB,mBAAmB,GACnB,gCAAgC,GAChC,+BAA+B,GAC/B,iCAAiC,UAC7B,YAAY,KACnB,IAAI,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,QAAQ,YAAY,CAgEtB,CAAC;AAEF,UAAU,6BAA6B;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;IACzB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,IAAI,EAAE,cAAc,EAAE,CAA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O,CAAC,YAAY;CAarB"}
@@ -153,8 +153,7 @@ class PermissionLinter extends base_linter_1.default {
153
153
  new visitors_1.UIHookNodeVisitor(),
154
154
  new visitors_1.StorageAPINodeVisitor(),
155
155
  new visitors_1.ExternalApiCallVisitor(),
156
- new visitors_1.ImageUrlVisitor(),
157
- new visitors_1.ContentPropertyVisitor()
156
+ new visitors_1.ImageUrlVisitor()
158
157
  ];
159
158
  const humanReadableEnvironment = (0, cli_shared_1.environmentToOption)(this.environment);
160
159
  this.verifiers = {
@@ -164,8 +163,7 @@ class PermissionLinter extends base_linter_1.default {
164
163
  storage: new verifiers_1.StorageAPIVerifier(humanReadableEnvironment, this.manifest),
165
164
  uiHook: new verifiers_1.UIHookVerifier(humanReadableEnvironment, this.manifest),
166
165
  external: new verifiers_1.ExternalFetchVerifier(humanReadableEnvironment, this.manifest),
167
- image: new verifiers_1.ImageUrlVerifier(humanReadableEnvironment, this.manifest),
168
- contentProperty: new verifiers_1.ContentPropertyVerifier(humanReadableEnvironment, this.manifest)
166
+ image: new verifiers_1.ImageUrlVerifier(humanReadableEnvironment, this.manifest)
169
167
  };
170
168
  }
171
169
  setupMatchesMap(filepath) {
@@ -178,8 +176,7 @@ class PermissionLinter extends base_linter_1.default {
178
176
  uiHook: [],
179
177
  storage: [],
180
178
  external: [],
181
- image: [],
182
- contentProperty: []
179
+ image: []
183
180
  });
184
181
  }
185
182
  getFixer() {
@@ -203,9 +200,6 @@ class PermissionLinter extends base_linter_1.default {
203
200
  case api_call_interface_1.ApiCallTypes.IMAGE:
204
201
  criteriaMatches.image.push(apiCall);
205
202
  break;
206
- case api_call_interface_1.ApiCallTypes.CONTENT_PROPERTY:
207
- criteriaMatches.contentProperty.push(apiCall);
208
- break;
209
203
  }
210
204
  }
211
205
  async getProductPaths(cacheKey, url) {
@@ -2,6 +2,5 @@ export * from './product-verifier';
2
2
  export * from './storage-api-verifier';
3
3
  export * from './ui-hook-verifier';
4
4
  export * from './external-fetch-verifier';
5
- export * from './content-property-verifier';
6
5
  export * from './image-url-verifier';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
@@ -5,5 +5,4 @@ tslib_1.__exportStar(require("./product-verifier"), exports);
5
5
  tslib_1.__exportStar(require("./storage-api-verifier"), exports);
6
6
  tslib_1.__exportStar(require("./ui-hook-verifier"), exports);
7
7
  tslib_1.__exportStar(require("./external-fetch-verifier"), exports);
8
- tslib_1.__exportStar(require("./content-property-verifier"), exports);
9
8
  tslib_1.__exportStar(require("./image-url-verifier"), exports);
@@ -2,6 +2,5 @@ export * from './product-node-visitor';
2
2
  export * from './storage-api-node-visitor';
3
3
  export * from './ui-hook-node-visitor';
4
4
  export * from './external-fetch-call-visitor';
5
- export * from './content-property-visitor';
6
5
  export * from './image-url-visitor';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
@@ -5,5 +5,4 @@ tslib_1.__exportStar(require("./product-node-visitor"), exports);
5
5
  tslib_1.__exportStar(require("./storage-api-node-visitor"), exports);
6
6
  tslib_1.__exportStar(require("./ui-hook-node-visitor"), exports);
7
7
  tslib_1.__exportStar(require("./external-fetch-call-visitor"), exports);
8
- tslib_1.__exportStar(require("./content-property-visitor"), exports);
9
8
  tslib_1.__exportStar(require("./image-url-visitor"), exports);
@@ -1,9 +1,5 @@
1
1
  export declare const messages: {
2
2
  verifiers: {
3
- contentProperty: {
4
- message: (context: string, method: string, scope: string) => string;
5
- reference: string;
6
- };
7
3
  externalFetch: {
8
4
  message: (url: string) => string;
9
5
  reference: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;+BAGI,MAAM,UAAU,MAAM,SAAS,MAAM,KAAG,MAAM;;;;2BAKlD,MAAM;;;;2BAKN,MAAM;2BAER,MAAM;;;;2BAKJ,MAAM;;;;iCAKA,MAAM;;;;iCAKN,MAAM;;;;8BAKT,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;CAK3D,CAAC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;2BAGA,MAAM;;;;2BAKN,MAAM;2BAER,MAAM;;;;2BAKJ,MAAM;;;;iCAKA,MAAM;;;;iCAKN,MAAM;;;;8BAKT,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;CAK3D,CAAC"}
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.messages = void 0;
4
4
  exports.messages = {
5
5
  verifiers: {
6
- contentProperty: {
7
- message: (context, method, scope) => `Using properties.${context}().${method}() requires the "${scope}" scope`,
8
- reference: 'permission-scope-required'
9
- },
10
6
  externalFetch: {
11
7
  message: (url) => `The domain ${url} is not included in the "permissions.external.images" section of your app's manifest.yml file`,
12
8
  reference: 'egress-permission-required'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/lint",
3
- "version": "5.3.5-next.1",
3
+ "version": "5.4.0-next.3",
4
4
  "description": "Linting for forge apps",
5
5
  "main": "out/index.js",
6
6
  "license": "UNLICENSED",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@atlassian/xen-test-util": "^4.2.0",
14
- "@forge/api": "^3.10.0-next.0",
14
+ "@forge/api": "^4.0.0-next.1",
15
15
  "@types/array.prototype.flatmap": "^1.2.6",
16
16
  "@types/cross-spawn": "^6.0.6",
17
17
  "@types/eslint": "8.56.2",
@@ -19,9 +19,9 @@
19
19
  "eslint-plugin-import": "^2.29.1"
20
20
  },
21
21
  "dependencies": {
22
- "@forge/cli-shared": "5.5.2-next.1",
22
+ "@forge/cli-shared": "5.5.2-next.2",
23
23
  "@forge/egress": "1.2.13",
24
- "@forge/manifest": "7.7.1",
24
+ "@forge/manifest": "7.7.2-next.0",
25
25
  "@typescript-eslint/typescript-estree": "^5.62.0",
26
26
  "array.prototype.flatmap": "^1.3.2",
27
27
  "atlassian-openapi": "^1.0.18",
@@ -1,11 +0,0 @@
1
- import { LintClass, LintResultRule } from '../../../linter-interface';
2
- import { BaseLintIssueVerifier, LintIssueVerifier } from '../../verifier-interface';
3
- import { ContentPropertyApiCall } from '../api-call-interface';
4
- import { RequiredScopes } from '@forge/manifest';
5
- export declare const CONTENT_PROPERTY_PERMISSIONS_MAP: Record<string, Record<string, RequiredScopes>>;
6
- export declare class ContentPropertyVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<ContentPropertyApiCall[]> {
7
- protected getLintClass(): LintClass;
8
- process(apiCalls: ContentPropertyApiCall[]): Promise<LintResultRule[]>;
9
- private getMissingScopes;
10
- }
11
- //# sourceMappingURL=content-property-verifier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-property-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/content-property-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAoB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEnE,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyD3F,CAAC;AAEF,qBAAa,uBACX,SAAQ,qBACR,YAAW,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;IAEtD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAsBnF,OAAO,CAAC,gBAAgB;CAKzB"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContentPropertyVerifier = exports.CONTENT_PROPERTY_PERMISSIONS_MAP = void 0;
4
- const linter_interface_1 = require("../../../linter-interface");
5
- const text_1 = require("../../../text");
6
- const verifier_interface_1 = require("../../verifier-interface");
7
- const manifest_1 = require("@forge/manifest");
8
- exports.CONTENT_PROPERTY_PERMISSIONS_MAP = {
9
- onJiraIssue: {
10
- get: {
11
- beta: ['read:issue.property:jira'],
12
- current: ['read:jira-work']
13
- },
14
- set: {
15
- beta: ['write:issue.property:jira'],
16
- current: ['write:jira-work']
17
- },
18
- delete: {
19
- beta: ['delete:issue.property:jira'],
20
- current: ['write:jira-work']
21
- }
22
- },
23
- onJiraProject: {
24
- get: {
25
- beta: ['read:project.property:jira'],
26
- current: ['read:jira-work']
27
- },
28
- set: {
29
- beta: ['write:project.property:jira'],
30
- current: ['manage:jira-project']
31
- },
32
- delete: {
33
- beta: ['delete:project.property:jira'],
34
- current: ['manage:jira-project']
35
- }
36
- },
37
- onConfluencePage: {
38
- get: {
39
- beta: ['read:content-details:confluence'],
40
- current: ['read:confluence-props']
41
- },
42
- set: {
43
- beta: ['read:content.property:confluence', 'write:content.property:confluence'],
44
- current: ['read:confluence-props', 'write:confluence-props']
45
- },
46
- delete: {
47
- beta: ['write:content.property:confluence'],
48
- current: ['write:confluence-props']
49
- }
50
- },
51
- onConfluenceSpace: {
52
- get: {
53
- beta: ['read:content-details:confluence'],
54
- current: ['read:confluence-props']
55
- },
56
- set: {
57
- beta: ['read:space.property:confluence', 'write:space.property:confluence'],
58
- current: ['read:confluence-props', 'write:confluence-props']
59
- },
60
- delete: {
61
- beta: ['write:space.property:confluence'],
62
- current: ['write:confluence-props']
63
- }
64
- }
65
- };
66
- class ContentPropertyVerifier extends verifier_interface_1.BaseLintIssueVerifier {
67
- getLintClass() {
68
- return linter_interface_1.LintClass.Error;
69
- }
70
- async process(apiCalls) {
71
- const lintErrors = [];
72
- for (const apiCall of apiCalls) {
73
- const missingScopes = await this.getMissingScopes(apiCall);
74
- for (const missingScope of missingScopes) {
75
- const { context, method, line, column } = apiCall;
76
- lintErrors.push({
77
- class: this.getLintClass(),
78
- message: text_1.messages.verifiers.contentProperty.message(context, method, missingScope),
79
- reference: text_1.messages.verifiers.contentProperty.reference,
80
- column,
81
- line,
82
- metadata: {
83
- missingPermission: missingScope
84
- }
85
- });
86
- }
87
- }
88
- return lintErrors;
89
- }
90
- getMissingScopes({ context, method }) {
91
- const existingScopes = this.manifest?.permissions?.scopes;
92
- return (0, manifest_1.getMissingScopes)(existingScopes, exports.CONTENT_PROPERTY_PERMISSIONS_MAP[context][method]);
93
- }
94
- }
95
- exports.ContentPropertyVerifier = ContentPropertyVerifier;
@@ -1,9 +0,0 @@
1
- import { TSESTree } from '@typescript-eslint/typescript-estree';
2
- import { NodeVisitor } from '../../node-visitor-interface';
3
- import { ApiCall } from '../api-call-interface';
4
- export declare const CONTENT_PROPERTY_METHODS: string[];
5
- export declare class ContentPropertyVisitor implements NodeVisitor<ApiCall> {
6
- visit(node: TSESTree.Node, parent: TSESTree.Node | undefined, callback: (apiCall: ApiCall) => void): void;
7
- private nodeIsPropertiesObject;
8
- }
9
- //# sourceMappingURL=content-property-visitor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-property-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/content-property-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAwC,MAAM,uBAAuB,CAAC;AAGtF,eAAO,MAAM,wBAAwB,UAAgD,CAAC;AAEtF,qBAAa,sBAAuB,YAAW,WAAW,CAAC,OAAO,CAAC;IAC1D,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;IA6BhH,OAAO,CAAC,sBAAsB;CAc/B"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContentPropertyVisitor = exports.CONTENT_PROPERTY_METHODS = void 0;
4
- const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
5
- const api_call_interface_1 = require("../api-call-interface");
6
- const content_property_verifier_1 = require("../verifiers/content-property-verifier");
7
- exports.CONTENT_PROPERTY_METHODS = Object.keys(content_property_verifier_1.CONTENT_PROPERTY_PERMISSIONS_MAP);
8
- class ContentPropertyVisitor {
9
- visit(node, parent, callback) {
10
- if (node.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
11
- node.object.type === typescript_estree_1.AST_NODE_TYPES.CallExpression &&
12
- node.object.callee.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
13
- this.nodeIsPropertiesObject(node.object.callee.object) &&
14
- node.object.callee.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
15
- exports.CONTENT_PROPERTY_METHODS.includes(node.object.callee.property.name) &&
16
- node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
17
- node.property.name.match(/^get|set|delete$/)) {
18
- const apiCall = {
19
- type: api_call_interface_1.ApiCallTypes.CONTENT_PROPERTY,
20
- line: node.property.loc.start.line,
21
- column: node.property.loc.start.column,
22
- context: node.object.callee.property.name,
23
- method: node.property.name
24
- };
25
- callback(apiCall);
26
- }
27
- }
28
- nodeIsPropertiesObject(objectNode) {
29
- const isProperties = objectNode.type === typescript_estree_1.AST_NODE_TYPES.Identifier && objectNode.name === 'properties';
30
- const isApiProperties = objectNode.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
31
- objectNode.object.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
32
- objectNode.object.name === 'api' &&
33
- objectNode.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
34
- objectNode.property.name === 'properties';
35
- return isApiProperties || isProperties;
36
- }
37
- }
38
- exports.ContentPropertyVisitor = ContentPropertyVisitor;