diff --git a/build-system/compile/compile.js b/build-system/compile/compile.js index cf803b03623f..76c55a4ec612 100644 --- a/build-system/compile/compile.js +++ b/build-system/compile/compile.js @@ -371,6 +371,7 @@ function compile(entryModuleFilenames, outputDir, outputFilename, options) { // it won't do strict type checking if its whitespace only. compilerOptions.define.push('TYPECHECK_ONLY=true'); compilerOptions.jscomp_error.push( + 'conformanceViolations', 'checkTypes', 'accessControls', 'const', diff --git a/build-system/conformance-config.textproto b/build-system/conformance-config.textproto index 13e63537dde9..f59e3eb0516a 100644 --- a/build-system/conformance-config.textproto +++ b/build-system/conformance-config.textproto @@ -258,6 +258,7 @@ requirement: { whitelist: 'src/web-worker/web-worker.js' # Allowing violations in ads code for now. # We would have to fix this to property obfuscated the 3p frame code. + whitelist: '3p/iframe-messaging-client.js' whitelist: 'ads/google/deprecated_doubleclick.js' whitelist: 'ads/google/imaVideo.js' } @@ -348,10 +349,11 @@ requirement: { whitelist: 'extensions/amp-date-picker/0.1/dates-list.js' } -requirement: { - type: BANNED_PROPERTY_CALL - error_message: 'ChildNode.p.after() is unusual. Please use Node.p.insertBefore()' - value: 'Element.prototype.after' - value: 'DocumentType.prototype.after' - value: 'CharacterData.prototype.after' -} +# TODO(rsimha): Reenable when we move RRule to a node module. +# requirement: { + # type: BANNED_PROPERTY_CALL + # error_message: 'ChildNode.p.after() is unusual. Please use Node.p.insertBefore()' + # value: 'Element.prototype.after' + # value: 'DocumentType.prototype.after' + # value: 'CharacterData.prototype.after' +# } diff --git a/extensions/amp-auto-ads/0.1/anchor-ad-strategy.js b/extensions/amp-auto-ads/0.1/anchor-ad-strategy.js index b7d34de47c80..f8ce6f07cc4f 100644 --- a/extensions/amp-auto-ads/0.1/anchor-ad-strategy.js +++ b/extensions/amp-auto-ads/0.1/anchor-ad-strategy.js @@ -88,9 +88,9 @@ export class AnchorAdStrategy { * @private */ isFilledAnchorAdEnabled_() { - return (this.configObj_['optInStatus'] || []).includes( - OptInStatus.OPT_IN_STATUS_ANCHOR_ADS - ); + return user() + .assertArray(this.configObj_['optInStatus'] || []) + .includes(OptInStatus.OPT_IN_STATUS_ANCHOR_ADS); } /** @@ -98,9 +98,9 @@ export class AnchorAdStrategy { * @private */ isNoFillAnchorAdEnabled_() { - return (this.configObj_['optInStatus'] || []).includes( - OptInStatus.OPT_IN_STATUS_NO_FILL_ANCHOR_ADS - ); + return user() + .assertArray(this.configObj_['optInStatus'] || []) + .includes(OptInStatus.OPT_IN_STATUS_NO_FILL_ANCHOR_ADS); } /** diff --git a/extensions/amp-experiment/1.0/attribute-allow-list/allowed-attribute-mutation-entry.js b/extensions/amp-experiment/1.0/attribute-allow-list/allowed-attribute-mutation-entry.js index 04fdba8effeb..9236e0de726c 100644 --- a/extensions/amp-experiment/1.0/attribute-allow-list/allowed-attribute-mutation-entry.js +++ b/extensions/amp-experiment/1.0/attribute-allow-list/allowed-attribute-mutation-entry.js @@ -30,9 +30,7 @@ export class AllowedAttributeMutationEntry { * @return {boolean} */ validate(mutationRecord) { - if (mutationRecord['value']) { - return true; - } + return !!mutationRecord['value']; } /** diff --git a/extensions/amp-geo/0.1/amp-geo.js b/extensions/amp-geo/0.1/amp-geo.js index 30f703f3042a..a8107fe2a50d 100644 --- a/extensions/amp-geo/0.1/amp-geo.js +++ b/extensions/amp-geo/0.1/amp-geo.js @@ -343,7 +343,9 @@ export class AmpGeo extends AMP.BaseElement { const {classList} = body; // Always remove the pending class classesToRemove.push('amp-geo-pending'); - classesToRemove.forEach(toRemove => classList.remove(toRemove)); + classesToRemove.forEach(toRemove => { + /** @type {!DOMTokenList} */ (classList).remove(toRemove); + }); // add the new classes to classesToAdd.forEach(toAdd => classList.add(toAdd)); diff --git a/extensions/amp-story/1.0/page-advancement.js b/extensions/amp-story/1.0/page-advancement.js index f94c4ce01270..87a0fe9cd556 100644 --- a/extensions/amp-story/1.0/page-advancement.js +++ b/extensions/amp-story/1.0/page-advancement.js @@ -541,9 +541,10 @@ class ManualAdvancement extends AdvancementConfig { */ isHandledByEmbeddedComponent_(event, pageRect) { const target = dev().assertElement(event.target); - const inExpandedMode = - this.storeService_.get(StateProperty.INTERACTIVE_COMPONENT_STATE) - .state === EmbeddedComponentState.EXPANDED; + const stored = /** @type {InteractiveComponentDef} */ (this.storeService_.get( + StateProperty.INTERACTIVE_COMPONENT_STATE + )); + const inExpandedMode = stored.state === EmbeddedComponentState.EXPANDED; return ( inExpandedMode ||