Skip to content

Commit

Permalink
introduce pageexperience mode (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbenz authored and tharders committed Aug 17, 2020
1 parent 961bdc7 commit c3d57f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/linter/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function cli(argv: string[], logger = console, cmd = "amplint") {
.option(
`-f, --force <string>`,
"override test type",
/^(auto|sxg|amp|ampstory)$/i, // needs to be of type LintMode | "auto"
/^(auto|sxg|amp|ampstory|pageexperience)$/i, // needs to be of type LintMode | "auto"
"auto"
)
.option(
Expand Down
8 changes: 8 additions & 0 deletions packages/linter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export enum LintMode {
AmpStory = "ampstory",
Amp4Ads = "amp4ads",
Amp4Email = "amp4email",
PageExperience = "pageexperience",
Sxg = "sxg",
}

Expand Down Expand Up @@ -122,6 +123,13 @@ function testsForMode(type: LintMode) {
TitleMeetsLengthCriteria,
])
);
tests.set(
LintMode.PageExperience,
(tests.get(LintMode.PageExperience) || []).concat([
IsValid,
RuntimeIsPreloaded,
])
);
return tests.get(type) || [];
}

Expand Down

0 comments on commit c3d57f8

Please sign in to comment.