diff --git a/packages/cache-list/lib/AmpCaches.js b/packages/cache-list/lib/AmpCaches.js index 39b11ca04..66472b8e6 100644 --- a/packages/cache-list/lib/AmpCaches.js +++ b/packages/cache-list/lib/AmpCaches.js @@ -60,7 +60,7 @@ class AmpCaches { } /** - * Retrieves the cache instance that maches the cacheId. + * Retrieves the cache instance that matches the cacheId. * * @param {string} cacheId The id of the cache to be retrieved. * @returns {Promise} the Cache which the matching id or undefined, if a cache with the diff --git a/packages/linter/src/rules/VideosAreSubtitled.ts b/packages/linter/src/rules/VideosAreSubtitled.ts index 9be2c5916..579a3e9e1 100644 --- a/packages/linter/src/rules/VideosAreSubtitled.ts +++ b/packages/linter/src/rules/VideosAreSubtitled.ts @@ -8,7 +8,7 @@ export class VideosAreSubtitled extends Rule { //Are there any tags? If so, is there at least 1 ? return numOfVideoElems > 0 && numOfSubtitleElems <= 0 - ? this.warn(`One or more videos are missing HMTL subtitles`) + ? this.warn(`One or more videos are missing HTML subtitles`) : this.pass(); } meta() { diff --git a/packages/optimizer-docker/spec/index.spec.js b/packages/optimizer-docker/spec/index.spec.js index 5ae303d3d..9ee651187 100644 --- a/packages/optimizer-docker/spec/index.spec.js +++ b/packages/optimizer-docker/spec/index.spec.js @@ -33,7 +33,7 @@ describe('Server integration tests', () => { }); }); - it('should run the provided HTML throught the optimizer', async () => { + it('should run the provided HTML through the optimizer', async () => { const {body} = await request({body: VALID_REQUEST, query: {canonical: 'http://example.com'}}); expect(body).toMatch(''); expect(body).toMatch(''); diff --git a/packages/optimizer-express/lib/AmpOptimizeMiddleware.js b/packages/optimizer-express/lib/AmpOptimizeMiddleware.js index e09fe9f9d..d867e72e9 100644 --- a/packages/optimizer-express/lib/AmpOptimizeMiddleware.js +++ b/packages/optimizer-express/lib/AmpOptimizeMiddleware.js @@ -40,7 +40,7 @@ class AmpOptimizerMiddleware { return; } - // This is a request for the canonical URL. Setup the middelware to transform the + // This is a request for the canonical URL. Setup the middleware to transform the // response using amp-optimizer. const chunks = []; @@ -78,7 +78,7 @@ class AmpOptimizerMiddleware { chunks.push(chunk); } - // If end is called withouth any chunks, end the request. + // If end is called without any chunks, end the request. if (chunks.length === 0) { res.end(); return; @@ -104,7 +104,7 @@ class AmpOptimizerMiddleware { * Javascript or CSS file. * * @param {Request} req the request to be checked. - * @returns {boolean} true if the reqeust is for a resource. + * @returns {boolean} true if the request is for a resource. */ static isResourceRequest_(req) { // Checks if mime-type for request is text/html. If mime type is unknown, assume text/html, diff --git a/packages/optimizer-express/spec/lib/UrlMappingSpec.js b/packages/optimizer-express/spec/lib/UrlMappingSpec.js index 6876c1601..804c8d1c2 100644 --- a/packages/optimizer-express/spec/lib/UrlMappingSpec.js +++ b/packages/optimizer-express/spec/lib/UrlMappingSpec.js @@ -30,7 +30,7 @@ describe('UrlMapping', () => { expect(result).toBe(true); }); - it('correcty identifies non-AMP urls', () => { + it('correctly identifies non-AMP urls', () => { const result = urlMapping.isAmpUrl('/page'); expect(result).toBe(false); }); diff --git a/packages/optimizer/lib/DomTransformer.js b/packages/optimizer/lib/DomTransformer.js index f6d884913..6958b1bb0 100644 --- a/packages/optimizer/lib/DomTransformer.js +++ b/packages/optimizer/lib/DomTransformer.js @@ -23,7 +23,7 @@ const fetchRuntimeParameters = require('./fetchRuntimeParameters'); const cache = require('./cache'); /** - * AMP Optimizer Configuration only applying AMP validity perserving transformations. + * AMP Optimizer Configuration only applying AMP validity preserving transformations. */ const TRANSFORMATIONS_AMP_FIRST = [ // Adds missing AMP tags diff --git a/packages/optimizer/lib/ParseLayout.js b/packages/optimizer/lib/ParseLayout.js index 2af7b8daa..fdb240e41 100644 --- a/packages/optimizer/lib/ParseLayout.js +++ b/packages/optimizer/lib/ParseLayout.js @@ -37,7 +37,7 @@ const SIZE_DEFINED_LAYOUTS = [ ]; const CSS_LENGTH_ONE_PX = cssLength('1', false, false); const CSS_LENGTH_AUTO = cssLength('auto', true, false); -const CSS_LENGTH_FOURTY_FOUR_PX = cssLength('44px', false, false); +const CSS_LENGTH_FORTY_FOUR_PX = cssLength('44px', false, false); const CSS_LENGTH_SIXTY_PX = cssLength('60px', false, false); function getLayoutClass(layout) { @@ -62,7 +62,7 @@ function calculateHeight(inputLayout, inputHeight, tagName) { case 'amp-pixel': return CSS_LENGTH_ONE_PX; case 'amp-social-share': - return CSS_LENGTH_FOURTY_FOUR_PX; + return CSS_LENGTH_FORTY_FOUR_PX; default: } } diff --git a/packages/optimizer/lib/transformers/AddBlurryImagePlaceholders.js b/packages/optimizer/lib/transformers/AddBlurryImagePlaceholders.js index 55116bd0b..d43fae2ee 100644 --- a/packages/optimizer/lib/transformers/AddBlurryImagePlaceholders.js +++ b/packages/optimizer/lib/transformers/AddBlurryImagePlaceholders.js @@ -103,7 +103,7 @@ class AddBlurryImagePlaceholders { this.cache_ = new Map(); } else if (maxCacheSize > 0) { const LRU = require('lru-cache'); - this.log_.debug('using LRU cache for regularily used placeholders', maxCacheSize); + this.log_.debug('using LRU cache for regularly used placeholders', maxCacheSize); // use a LRU cache otherwise this.cache_ = new LRU({ max: maxCacheSize, diff --git a/packages/optimizer/lib/transformers/AutoExtensionImporter.js b/packages/optimizer/lib/transformers/AutoExtensionImporter.js index 84d4a4228..15b269722 100644 --- a/packages/optimizer/lib/transformers/AutoExtensionImporter.js +++ b/packages/optimizer/lib/transformers/AutoExtensionImporter.js @@ -43,12 +43,12 @@ const manualExtensions = Array.from(manualAttributeToExtensionMapping.values()); * * - use validation rules to map used AMP tags to required AMP extensions. * - use validation rules to map used AMP attributes to required AMP extensions. - * - manually specifiy attribute to extension mappings if this information is not available in the + * - manually specify attribute to extension mappings if this information is not available in the * validation rules. - * - mnullay implement AMP extension detection for a few corner cases. + * - manually implement AMP extension detection for a few corner cases. * * This importer also enables a shortcode `bindtext` instead of `data-amp-bind-text` for specifying - * AMP bindings when the square bracket notation (`[text]`) is not available. To avoid accidently + * AMP bindings when the square bracket notation (`[text]`) is not available. To avoid accidentally * rewriting non-AMP attributes, the transformer uses the AMP validation rules to only rename bindable * attributes as specified in the validation rules. * diff --git a/packages/optimizer/lib/transformers/OptimizeImages.js b/packages/optimizer/lib/transformers/OptimizeImages.js index a55a248b3..5b16f6a48 100644 --- a/packages/optimizer/lib/transformers/OptimizeImages.js +++ b/packages/optimizer/lib/transformers/OptimizeImages.js @@ -70,7 +70,7 @@ class SrcsetWidth { } /** - * Sets the base width, i.e., renderered dimension measured in CSS pixels. + * Sets the base width, i.e., rendered dimension measured in CSS pixels. * Returns true if srcset is needed, that is, we'll resize the image to at * least 2 supported widths (@see SRCSET_WIDTH for a list of supported widths). * diff --git a/packages/optimizer/lib/transformers/PreloadHeroImage.js b/packages/optimizer/lib/transformers/PreloadHeroImage.js index d743a68b4..64b464559 100644 --- a/packages/optimizer/lib/transformers/PreloadHeroImage.js +++ b/packages/optimizer/lib/transformers/PreloadHeroImage.js @@ -16,7 +16,7 @@ 'use strict'; -/* This transfomer has been deprecated, use OptimizeHeroImages.js instead */ +/* This transformer has been deprecated, use OptimizeHeroImages.js instead */ /** @module PreloadHeroImage */ module.exports = require('./OptimizeHeroImages'); diff --git a/packages/optimizer/lib/transformers/PreloadImages.js b/packages/optimizer/lib/transformers/PreloadImages.js index f64c60947..48b0eb613 100644 --- a/packages/optimizer/lib/transformers/PreloadImages.js +++ b/packages/optimizer/lib/transformers/PreloadImages.js @@ -35,7 +35,7 @@ const MAX_PRELOADED_IMAGES = 5; * * This transformer supports the following option: * - * * `imagePreloadCount`: specifies the maxinum number of images to preload. The default is 5. + * * `imagePreloadCount`: specifies the maximum number of images to preload. The default is 5. */ class PreloadImages { transform(root, params) { diff --git a/packages/optimizer/lib/transformers/RewriteAmpUrls.js b/packages/optimizer/lib/transformers/RewriteAmpUrls.js index debfef6bd..67fb32677 100644 --- a/packages/optimizer/lib/transformers/RewriteAmpUrls.js +++ b/packages/optimizer/lib/transformers/RewriteAmpUrls.js @@ -118,7 +118,7 @@ class RewriteAmpUrls { node = node.nextSibling; } - // process preloads later to avoid accidently rewriting the URL + // process preloads later to avoid accidentally rewriting the URL for (const preload of preloads) { if (preload) { insertAfter(head, preload, referenceNode); diff --git a/packages/optimizer/spec/transformers/TransformerSpec.js b/packages/optimizer/spec/transformers/TransformerSpec.js index 2632ddbe2..bf5dc04aa 100644 --- a/packages/optimizer/spec/transformers/TransformerSpec.js +++ b/packages/optimizer/spec/transformers/TransformerSpec.js @@ -21,15 +21,15 @@ log.verbose(); const {getDirectories} = require('../helpers/Utils.js'); const createSpec = require('../helpers/TransformerRunner.js'); -describe('Transfomers', () => { +describe('Transformers', () => { ['experimental', 'valid'].forEach((subDir) => { loadTestConfigs(subDir).forEach(createSpec); }); }); function loadTestConfigs(subDir) { - const transfomerTestDirs = getDirectories(join(__dirname, subDir)); - return transfomerTestDirs.map((testDir) => { + const transformerTestDirs = getDirectories(join(__dirname, subDir)); + return transformerTestDirs.map((testDir) => { const transformerName = basename(testDir); const transformerPath = join('../../lib/transformers', transformerName + '.js'); diff --git a/packages/page-experience/lib/PageDataGatherer.js b/packages/page-experience/lib/PageDataGatherer.js index 07bb69996..3f5056dd0 100644 --- a/packages/page-experience/lib/PageDataGatherer.js +++ b/packages/page-experience/lib/PageDataGatherer.js @@ -276,7 +276,7 @@ class PageAnalyzer { request.resourceType() === 'script' && !request.url().startsWith('https://cdn.ampproject.org') ) { - // Only donwload AMP runtime scripts as they're need for layouting the page + // Only download AMP runtime scripts as they're need for layouting the page // Once self-hosting is a thing we'll have to change this // TODO: investigate whether we could cache these locally return request.abort(); diff --git a/packages/page-experience/lib/checks/earlyIframes.js b/packages/page-experience/lib/checks/earlyIframes.js index db036725c..4612f289b 100644 --- a/packages/page-experience/lib/checks/earlyIframes.js +++ b/packages/page-experience/lib/checks/earlyIframes.js @@ -25,7 +25,7 @@ const earlyIframes = (pageData, result) => { } result.warn({ - title: 'Avoid iframes at the begining of pages', + title: 'Avoid iframes at the beginning of pages', message: 'You have iframes at the top of your page - move them below the initial viewport to improve your loading time', }); diff --git a/packages/page-experience/test-data/checks/earlyIframes/iframe-in-first-viewport.json b/packages/page-experience/test-data/checks/earlyIframes/iframe-in-first-viewport.json index daad7bfe4..bb0f13919 100644 --- a/packages/page-experience/test-data/checks/earlyIframes/iframe-in-first-viewport.json +++ b/packages/page-experience/test-data/checks/earlyIframes/iframe-in-first-viewport.json @@ -16,8 +16,8 @@ } }, "earlyIframes": { - "title": "Avoid iframes at the begining of pages", + "title": "Avoid iframes at the beginning of pages", "message": "You have iframes at the top of your page - move them below the initial viewport to improve your loading time", "status": "WARN" } -} \ No newline at end of file +}