| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -111,7 +111,7 @@ | |||
| 111 | 111 | "postcss": "^5.2.6", | |
| 112 | 112 | "postcss-pxtorem": "^3.3.1", | |
| 113 | 113 | "postcss-reporter": "^1.4.1", | |
| 114 | - "prettier": "^1.2.2", | ||
| 114 | + "prettier": "^1.3.0", | ||
| 115 | 115 | "prettysize": "^0.0.3", | |
| 116 | 116 | "raw-loader": "^0.5.1", | |
| 117 | 117 | "request": "^2.81.0", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ const easeOut = (power: number): Function => t => | |||
| 15 | 15 | 1 - Math.abs((t - 1) ** power); | |
| 16 | 16 | ||
| 17 | 17 | const easeInOut = (power: number): Function => t => | |
| 18 | - (t < 0.5 ? easeIn(power)(t * 2) / 2 : easeOut(power)(t * 2 - 1) / 2 + 0.5); | ||
| 18 | + t < 0.5 ? easeIn(power)(t * 2) / 2 : easeOut(power)(t * 2 - 1) / 2 + 0.5; | ||
| 19 | 19 | ||
| 20 | 20 | // #? these probably should not be generated on parse but on being called | |
| 21 | 21 | const easingFunctions = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,9 +160,7 @@ const update = (state: State, container: Element): Promise<number> => { | |||
| 160 | 160 | ); | |
| 161 | 161 | if (activeEl != null) | |
| 162 | 162 | activeEl.classList.remove('video-playlist__item--active'); | |
| 163 | - const newActive = container.querySelector( | ||
| 164 | - `.js-video-playlist-item-${state.position}` | ||
| 165 | - ); | ||
| 163 | + const newActive = container.querySelector(`.js-video-playlist-item-${state.position}`); | ||
| 166 | 164 | if (newActive != null) | |
| 167 | 165 | newActive.classList.add('video-playlist__item--active'); | |
| 168 | 166 | ||
@@ -184,9 +182,7 @@ const update = (state: State, container: Element): Promise<number> => { | |||
| 184 | 182 | videojs($(el)[0]).pause(); | |
| 185 | 183 | }); | |
| 186 | 184 | ||
| 187 | - const activePlaylistItem = container.querySelector( | ||
| 188 | - `.js-video-playlist-item-${state.position}` | ||
| 189 | - ); | ||
| 185 | + const activePlaylistItem = container.querySelector(`.js-video-playlist-item-${state.position}`); | ||
| 190 | 186 | if (activePlaylistItem != null) | |
| 191 | 187 | activePlaylistItem.classList.add('video-playlist__item--active'); | |
| 192 | 188 | ||
@@ -228,9 +224,9 @@ const setupDispatches = ( | |||
| 228 | 224 | ||
| 229 | 225 | // #? is this over-kill? should we use Redux? | |
| 230 | 226 | const reducer = (previousState: State, action: Action): State => | |
| 231 | - (reducers[action.type] | ||
| 227 | + reducers[action.type] | ||
| 232 | 228 | ? reducers[action.type](previousState) | |
| 233 | - : previousState); | ||
| 229 | + : previousState; | ||
| 234 | 230 | ||
| 235 | 231 | const createStore = ( | |
| 236 | 232 | storeReducer: (s: State, a: Action) => State, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,32 +19,35 @@ const mimeTypes = { | |||
| 19 | 19 | ||
| 20 | 20 | const typeFaces = require('./index.config'); | |
| 21 | 21 | ||
| 22 | - const toDataURI = (srcPath, data) => | ||
| 23 | - `url(data:${mimeTypes[path | ||
| 24 | - .extname(srcPath) | ||
| 25 | - .substr(1)]};base64,${data.toString()})`; | ||
| 22 | + const toDataURI = ( | ||
| 23 | + srcPath, | ||
| 24 | + data | ||
| 25 | + ) => `url(data:${mimeTypes[path | ||
| 26 | + .extname(srcPath) | ||
| 27 | + .substr(1)]};base64,${data.toString()})`; | ||
| 26 | 28 | ||
| 27 | 29 | const generateCSS = (fontFamily, font) => | |
| 28 | 30 | readFile(path.resolve(src, 'fonts', `${font.src}`), 'base64') | |
| 29 | 31 | .then(data => | |
| 30 | - postcss([perfectionist({ format: 'compressed' })]).process( | ||
| 31 | - ` | ||
| 32 | + postcss([perfectionist({ format: 'compressed' })]).process(` | ||
| 32 | 33 | @font-face { | |
| 33 | 34 | font-family: ${fontFamily}; | |
| 34 | 35 | src: ${toDataURI(font.src, data)}; | |
| 35 | 36 | ${[ | |
| 36 | - 'font-weight', | ||
| 37 | - 'font-style', | ||
| 38 | - 'font-stretch', | ||
| 39 | - 'font-variant', | ||
| 40 | - 'font-feature-settings', | ||
| 41 | - 'unicode-range', | ||
| 42 | - ] | ||
| 43 | - .map(prop => (font[prop] ? `${prop}: ${font[prop]};` : '')) | ||
| 44 | - .join('')} | ||
| 37 | + 'font-weight', | ||
| 38 | + 'font-style', | ||
| 39 | + 'font-stretch', | ||
| 40 | + 'font-variant', | ||
| 41 | + 'font-feature-settings', | ||
| 42 | + 'unicode-range', | ||
| 43 | + ] | ||
| 44 | + .map( | ||
| 45 | + prop => | ||
| 46 | + font[prop] ? `${prop}: ${font[prop]};` : '' | ||
| 47 | + ) | ||
| 48 | + .join('')} | ||
| 45 | 49 | } | |
| 46 | - ` | ||
| 47 | - ) | ||
| 50 | + `) | ||
| 48 | 51 | ) | |
| 49 | 52 | .then(result => result.css); | |
| 50 | 53 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,9 +28,7 @@ module.exports = { | |||
| 28 | 28 | .sync('**/!(*.map)', { nodir: true, cwd: target }) | |
| 29 | 29 | .reduce((map, assetPath) => { | |
| 30 | 30 | const assetLocation = path.resolve(target, assetPath); | |
| 31 | - const hasSourceMap = fs.existsSync( | ||
| 32 | - `${assetLocation}.map` | ||
| 33 | - ); | ||
| 31 | + const hasSourceMap = fs.existsSync(`${assetLocation}.map`); | ||
| 34 | 32 | ||
| 35 | 33 | // webpack bundles come pre-hashed, so we won't hash them, just add them | |
| 36 | 34 | if (webpackRegex.test(assetPath)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,18 +3,15 @@ const chalk = require('chalk'); | |||
| 3 | 3 | const config = '--quiet --color'; | |
| 4 | 4 | ||
| 5 | 5 | const error = ctx => { | |
| 6 | - ctx.messages.push( | ||
| 7 | - `${chalk.blue('make fix')} can correct simple errors automatically.` | ||
| 8 | - ); | ||
| 9 | - ctx.messages.push( | ||
| 10 | - `Your editor may be able to catch eslint errors as you work:\n${chalk.underline('http://eslint.org/docs/user-guide/integrations#editors')}` | ||
| 11 | - ); | ||
| 6 | + ctx.messages | ||
| 7 | + .push(`${chalk.blue('make fix')} can correct simple errors automatically.`); | ||
| 8 | + ctx.messages | ||
| 9 | + .push(`Your editor may be able to catch eslint errors as you work:\n${chalk.underline('http://eslint.org/docs/user-guide/integrations#editors')}`); | ||
| 12 | 10 | }; | |
| 13 | 11 | ||
| 14 | 12 | const flowError = ctx => { | |
| 15 | - ctx.messages.push( | ||
| 16 | - `Your editor may be able to catch flow errors as you work:\n${chalk.underline('https://docs.google.com/a/guardian.co.uk/document/d/1-w5KdwNVAZcGRL3Q9QCvj5y3aQyoVizm6GrHQaqQHNE/edit?usp=sharing')}` | ||
| 17 | - ); | ||
| 13 | + ctx.messages | ||
| 14 | + .push(`Your editor may be able to catch flow errors as you work:\n${chalk.underline('https://docs.google.com/a/guardian.co.uk/document/d/1-w5KdwNVAZcGRL3Q9QCvj5y3aQyoVizm6GrHQaqQHNE/edit?usp=sharing')}`); | ||
| 18 | 15 | }; | |
| 19 | 16 | ||
| 20 | 17 | module.exports = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,9 +5,7 @@ const once = require('lodash/once'); | |||
| 5 | 5 | const fetch = options => { | |
| 6 | 6 | const onError = once(error => { | |
| 7 | 7 | if (options.host === exports.hosts.dev) { | |
| 8 | - console.error( | ||
| 9 | - `A 200 was not returned \n\n Are you running the article or dev-build app? \n \n ${error.message}` | ||
| 10 | - ); | ||
| 8 | + console.error(`A 200 was not returned \n\n Are you running the article or dev-build app? \n \n ${error.message}`); | ||
| 11 | 9 | } | |
| 12 | 10 | throw error; | |
| 13 | 11 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,9 +70,7 @@ const checkEndpoints = (endpoints, options) => validatorFilePath => | |||
| 70 | 70 | const results = partition(values, Boolean); | |
| 71 | 71 | const exitValue = results[1].length ? 1 : 0; // every promise returns true <=> exit value is zero | |
| 72 | 72 | ||
| 73 | - console.log( | ||
| 74 | - `Validator finished, there were ${results[0].length} passes and ${results[1].length} failures.` | ||
| 75 | - ); | ||
| 73 | + console.log(`Validator finished, there were ${results[0].length} passes and ${results[1].length} failures.`); | ||
| 76 | 74 | validatorJs.cleanUp(); | |
| 77 | 75 | process.exit(exitValue); | |
| 78 | 76 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,9 +66,7 @@ const analyse = filePath => { | |||
| 66 | 66 | .then(() => cloudwatch.log(path.basename(filePath), data)) | |
| 67 | 67 | .then(msg => { | |
| 68 | 68 | console.log( | |
| 69 | - chalk.green( | ||
| 70 | - `Successfully logged file data to CloudWatch ${msg.id}` | ||
| 71 | - ) | ||
| 69 | + chalk.green(`Successfully logged file data to CloudWatch ${msg.id}`) | ||
| 72 | 70 | ); | |
| 73 | 71 | return true; | |
| 74 | 72 | }) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,29 +77,25 @@ git | |||
| 77 | 77 | }) | |
| 78 | 78 | .catch(e => { | |
| 79 | 79 | console.log(chalk.red(e.stack)); | |
| 80 | - megalog.error( | ||
| 81 | - `\`${step}\` did not complete. | ||
| 80 | + megalog.error(`\`${step}\` did not complete. | ||
| 82 | 81 | ||
| 83 | 82 | Once you have fixed the problem, you'll need to run the remaining steps manually: | |
| 84 | 83 | ${Object.keys(steps) | |
| 85 | - .slice(i) | ||
| 86 | - .map((remaingStep, remainingCount) => ` | ||
| 84 | + .slice(i) | ||
| 85 | + .map((remaingStep, remainingCount) => ` | ||
| 87 | 86 | ${i + 1 + remainingCount}. ${remaingStep} | |
| 88 | 87 | \`${steps[remaingStep]}\` | |
| 89 | 88 | `) | |
| 90 | - .join('')} | ||
| 91 | - If you get stuck, feel free to ping us in: \`https://theguardian.slack.com/messages/dotcom-es2017\`\n\nYou may also want to double check the wiki guide: \`https://github.com/guardian/frontend/wiki/So-you-want-to-ES6%3F\`` | ||
| 92 | - ); | ||
| 89 | + .join('')} | ||
| 90 | + If you get stuck, feel free to ping us in: \`https://theguardian.slack.com/messages/dotcom-es2017\`\n\nYou may also want to double check the wiki guide: \`https://github.com/guardian/frontend/wiki/So-you-want-to-ES6%3F\``); | ||
| 93 | 91 | process.exit(1); | |
| 94 | 92 | }); | |
| 95 | 93 | }), | |
| 96 | 94 | Promise.resolve() | |
| 97 | 95 | ) | |
| 98 | 96 | .then(() => { | |
| 99 | 97 | console.log( | |
| 100 | - chalk.blue( | ||
| 101 | - `\n💫 Module is now es6! Double check the code, then create a PR.` | ||
| 102 | - ) | ||
| 98 | + chalk.blue(`\n💫 Module is now es6! Double check the code, then create a PR.`) | ||
| 103 | 99 | ); | |
| 104 | 100 | console.log(chalk.dim(`New location: ${es6Module}\n`)); | |
| 105 | 101 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments