Skip to content

Commit

Permalink
amp lint --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg committed Nov 17, 2023
1 parent 5ff16e1 commit 31a98b5
Show file tree
Hide file tree
Showing 30 changed files with 125 additions and 125 deletions.
40 changes: 20 additions & 20 deletions build-system/common/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ function isPullRequestBuild() {
return isGithubActions
? env('GITHUB_EVENT_NAME') === 'pull_request'
: isCircleci
? !isCircleciPushBranch(env('CIRCLE_BRANCH'))
: false;
? !isCircleciPushBranch(env('CIRCLE_BRANCH'))
: false;
}

/**
Expand All @@ -78,8 +78,8 @@ function isPushBuild() {
return isGithubActions
? env('GITHUB_EVENT_NAME') === 'push'
: isCircleci
? isCircleciPushBranch(env('CIRCLE_BRANCH'))
: false;
? isCircleciPushBranch(env('CIRCLE_BRANCH'))
: false;
}

/**
Expand All @@ -90,8 +90,8 @@ function ciPullRequestBranch() {
return isGithubActions
? env('GITHUB_HEAD_REF')
: isCircleci
? env('CIRCLE_BRANCH')
: '';
? env('CIRCLE_BRANCH')
: '';
}

/**
Expand All @@ -102,8 +102,8 @@ function ciPullRequestSha() {
return isGithubActions
? require(env('GITHUB_EVENT_PATH')).pull_request.head.sha
: isCircleci
? env('CIRCLE_SHA1')
: '';
? env('CIRCLE_SHA1')
: '';
}

/**
Expand All @@ -114,8 +114,8 @@ function ciPushBranch() {
return isGithubActions
? env('GITHUB_REF')
: isCircleci
? env('CIRCLE_BRANCH')
: '';
? env('CIRCLE_BRANCH')
: '';
}

/**
Expand All @@ -126,8 +126,8 @@ function ciCommitSha() {
return isGithubActions
? env('GITHUB_SHA')
: isCircleci
? env('CIRCLE_SHA1')
: '';
? env('CIRCLE_SHA1')
: '';
}

/**
Expand All @@ -138,8 +138,8 @@ function ciBuildId() {
return isGithubActions
? env('GITHUB_RUN_ID')
: isCircleci
? env('CIRCLE_WORKFLOW_ID')
: '';
? env('CIRCLE_WORKFLOW_ID')
: '';
}

/**
Expand All @@ -150,8 +150,8 @@ function ciBuildUrl() {
return isGithubActions
? `${env('GITHUB_SERVER_URL')}/${env('GITHUB_REPOSITORY')}/actions/runs/${env('GITHUB_RUN_ID')}` // prettier-ignore
: isCircleci
? `https://app.circleci.com/pipelines/workflows/${env('CIRCLE_WORKFLOW_ID')}` // prettier-ignore
: '';
? `https://app.circleci.com/pipelines/workflows/${env('CIRCLE_WORKFLOW_ID')}` // prettier-ignore
: '';
}

/**
Expand All @@ -162,8 +162,8 @@ function ciJobId() {
return isGithubActions
? env('GITHUB_RUN_NUMBER')
: isCircleci
? env('CIRCLE_JOB')
: '';
? env('CIRCLE_JOB')
: '';
}

/**
Expand Down Expand Up @@ -200,8 +200,8 @@ function ciRepoSlug() {
return isGithubActions
? env('GITHUB_REPOSITORY')
: isCircleci
? `${env('CIRCLE_PROJECT_USERNAME')}/${env('CIRCLE_PROJECT_REPONAME')}`
: '';
? `${env('CIRCLE_PROJECT_USERNAME')}/${env('CIRCLE_PROJECT_REPONAME')}`
: '';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions build-system/eslint-rules/restrict-this-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ module.exports = function (context) {
property.type === 'Identifier'
? property.name
: property.type === 'Literal'
? property.value
: null;
? property.value
: null;

if (!name) {
context.report({
Expand Down
4 changes: 2 additions & 2 deletions build-system/task-runner/amp-task-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function getTime(start) {
return mins !== 0
? `${mins}m ${secs}s`
: secs != 0
? `${secs}s`
: `${msecs}ms`;
? `${secs}s`
: `${msecs}ms`;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions build-system/tasks/get-zindex/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ async function getZindexJs(filename) {
const name = types.isStringLiteral(key)
? key.value
: types.isIdentifier(key)
? key.name
: null;
? key.name
: null;
if (!name) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions build-system/tasks/runtime-test/custom-launchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const customLaunchers = {
base: argv.headless
? 'ChromeHeadless'
: argv.chrome_canary
? 'ChromeCanary'
: 'Chrome',
? 'ChromeCanary'
: 'Chrome',
flags: argv.chrome_flags
? argv.chrome_flags.split(',').map((flag) => `--${flag}`)
: DEFAULT_CHROME_FLAGS,
Expand Down
8 changes: 4 additions & 4 deletions build-system/tasks/runtime-test/runtime-test-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ class RuntimeTestConfig {
const browser = argv.edge
? 'EdgeCustom'
: argv.firefox
? 'FirefoxCustom'
: argv.safari
? 'SafariCustom'
: 'ChromeCustom';
? 'FirefoxCustom'
: argv.safari
? 'SafariCustom'
: 'ChromeCustom';
Object.assign(this, {browsers: [browser], customLaunchers});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,9 @@ export class AmpAdNetworkDoubleclickImpl extends AmpA4A {
this.initialSize_ = this.isFluidPrimaryRequest_
? {width: 0, height: 0}
: width && height
? // width/height could be 'auto' in which case we fallback to measured.
{width, height}
: this.getIntersectionElementLayoutBox();
? // width/height could be 'auto' in which case we fallback to measured.
{width, height}
: this.getIntersectionElementLayoutBox();
this.jsonTargeting = tryParseJson(this.element.getAttribute('json')) || {};
this.adKey = this.generateAdKey_(
`${this.initialSize_.width}x${this.initialSize_.height}`
Expand Down
28 changes: 14 additions & 14 deletions extensions/amp-animation/0.1/parsers/css-expr-ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ export class CssConcatNode extends CssNode {
opt_array instanceof CssConcatNode
? opt_array.array_
: Array.isArray(opt_array)
? opt_array
: opt_array
? [opt_array]
: [];
? opt_array
: opt_array
? [opt_array]
: [];
/** @const @private {?Array<string>} */
this.dimensions_ = opt_dimensions || null;
}
Expand Down Expand Up @@ -707,8 +707,8 @@ export function createPositionNode(value) {
kw == 'left' || kw == 'right'
? 'w'
: kw == 'top' || kw == 'bottom'
? 'h'
: '';
? 'h'
: '';
dims[i] = dims[i + 1] = dim;
}
}
Expand Down Expand Up @@ -815,14 +815,14 @@ export class CssTranslateNode extends CssFuncNode {
suffix == ''
? ['w', 'h']
: suffix == 'x'
? ['w']
: suffix == 'y'
? ['h']
: suffix == 'z'
? ['z']
: suffix == '3d'
? ['w', 'h', 'z']
: null
? ['w']
: suffix == 'y'
? ['h']
: suffix == 'z'
? ['z']
: suffix == '3d'
? ['w', 'h', 'z']
: null
);
/** @const @protected {string} */
this.suffix_ = suffix;
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-animation/0.1/parsers/keyframes-extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ function buildKeyframes(keyframesRule) {
keyframeRule.keyText == 'from'
? 0
: keyframeRule.keyText == 'to'
? 1
: parseFloat(keyframeRule.keyText) / 100;
? 1
: parseFloat(keyframeRule.keyText) / 100;
const {style} = keyframeRule;
for (let j = 0; j < style.length; j++) {
const styleName = style[j];
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-animation/0.1/web-animations.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,8 @@ class CssContextImpl {
this.vars_ && this.vars_[varName] != undefined
? this.vars_[varName]
: this.currentTarget_
? this.measure(this.currentTarget_, varName)
: null;
? this.measure(this.currentTarget_, varName)
: null;
if (rawValue == null || rawValue === '') {
user().warn(TAG, `Variable not found: "${varName}"`);
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-app-banner/1.0/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export function BentoAppBanner(props) {
const AppBannerForCurrentPlatform = platformUtils.isIos()
? AppBannerIOS
: platformUtils.isAndroid()
? AppBannerAndroid
: null;
? AppBannerAndroid
: null;

if (!AppBannerForCurrentPlatform) {
logger.info(
Expand Down
24 changes: 12 additions & 12 deletions extensions/amp-carousel/0.1/slidescroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export class AmpSlideScroll extends AMP.BaseElement {
.startsWith('10.3')
? true
: this.isIos_
? false
: !isExperimentOn(this.win, 'amp-carousel-chrome-scroll-snap');
? false
: !isExperimentOn(this.win, 'amp-carousel-chrome-scroll-snap');

/** @private {boolean} */
this.hasFirstResizedOccured_ = false;
Expand Down Expand Up @@ -567,8 +567,8 @@ export class AmpSlideScroll extends AMP.BaseElement {
const timeout = this.hasNativeSnapPoints_
? NATIVE_SNAP_TIMEOUT
: this.isIos_
? IOS_CUSTOM_SNAP_TIMEOUT
: CUSTOM_SNAP_TIMEOUT;
? IOS_CUSTOM_SNAP_TIMEOUT
: CUSTOM_SNAP_TIMEOUT;
// Timer that detects scroll end and/or end of snap scroll.
this.waitForScrollSettled_(timeout);

Expand Down Expand Up @@ -693,15 +693,15 @@ export class AmpSlideScroll extends AMP.BaseElement {
newIndex < 0
? this.noOfSlides_ - 1
: newIndex >= this.noOfSlides_
? 0
: newIndex;
? 0
: newIndex;
} else {
newIndex =
newIndex < 0
? 0
: newIndex >= this.noOfSlides_
? this.noOfSlides_ - 1
: newIndex;
? this.noOfSlides_ - 1
: newIndex;
}
return newIndex;
}
Expand Down Expand Up @@ -779,8 +779,8 @@ export class AmpSlideScroll extends AMP.BaseElement {
return currentIndex - 1 >= 0
? currentIndex - 1
: this.shouldLoop_
? this.noOfSlides_ - 1
: null;
? this.noOfSlides_ - 1
: null;
}

/**
Expand All @@ -793,8 +793,8 @@ export class AmpSlideScroll extends AMP.BaseElement {
return currentIndex + 1 < this.noOfSlides_
? currentIndex + 1
: this.shouldLoop_
? 0
: null;
? 0
: null;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions extensions/amp-carousel/0.2/amp-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ class AmpCarousel extends AMP.BaseElement {
return currentIndex - 1 >= 0
? currentIndex - 1
: this.element.hasAttribute('loop')
? this.slides_.length - 1
: null;
? this.slides_.length - 1
: null;
}

/**
Expand All @@ -418,8 +418,8 @@ class AmpCarousel extends AMP.BaseElement {
return currentIndex + 1 < this.slides_.length
? currentIndex + 1
: this.element.hasAttribute('loop')
? 0
: null;
? 0
: null;
}

/**
Expand Down
16 changes: 8 additions & 8 deletions extensions/amp-date-countdown/0.1/amp-date-countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,18 @@ export class AmpDateCountdown extends AMP.BaseElement {
TimeUnit[this.biggestUnit_] == TimeUnit.HOURS
? this.supportBackDate_(Math.floor(ms / MILLISECONDS_IN_HOUR))
: TimeUnit[this.biggestUnit_] < TimeUnit.HOURS
? this.supportBackDate_(
Math.floor((ms % MILLISECONDS_IN_DAY) / MILLISECONDS_IN_HOUR)
)
: 0;
? this.supportBackDate_(
Math.floor((ms % MILLISECONDS_IN_DAY) / MILLISECONDS_IN_HOUR)
)
: 0;
const m =
TimeUnit[this.biggestUnit_] == TimeUnit.MINUTES
? this.supportBackDate_(Math.floor(ms / MILLISECONDS_IN_MINUTE))
: TimeUnit[this.biggestUnit_] < TimeUnit.MINUTES
? this.supportBackDate_(
Math.floor((ms % MILLISECONDS_IN_HOUR) / MILLISECONDS_IN_MINUTE)
)
: 0;
? this.supportBackDate_(
Math.floor((ms % MILLISECONDS_IN_HOUR) / MILLISECONDS_IN_MINUTE)
)
: 0;
const s =
TimeUnit[this.biggestUnit_] == TimeUnit.SECONDS
? this.supportBackDate_(Math.floor(ms / MILLISECONDS_IN_SECOND))
Expand Down
Loading

0 comments on commit 31a98b5

Please sign in to comment.