FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

update prettier · devhttps/frontend@59e5bca · GitHub

Commit 59e5bca

Browse files
committed
update prettier
1 parent 6ca6326 commit 59e5bca

14 files changed

Lines changed: 61 additions & 95 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"postcss": "^5.2.6",
112112
"postcss-pxtorem": "^3.3.1",
113113
"postcss-reporter": "^1.4.1",
114-
"prettier": "^1.2.2",
114+
"prettier": "^1.3.0",
115115
"prettysize": "^0.0.3",
116116
"raw-loader": "^0.5.1",
117117
"request": "^2.81.0",

‎static/src/javascripts/lib/easing.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const easeOut = (power: number): Function => t =>
1515
1 - Math.abs((t - 1) ** power);
1616

1717
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;
1919

2020
// #? these probably should not be generated on parse but on being called
2121
const easingFunctions = {

‎static/src/javascripts/projects/common/modules/video/video-container.js‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ const update = (state: State, container: Element): Promise<number> => {
160160
);
161161
if (activeEl != null)
162162
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}`);
166164
if (newActive != null)
167165
newActive.classList.add('video-playlist__item--active');
168166

@@ -184,9 +182,7 @@ const update = (state: State, container: Element): Promise<number> => {
184182
videojs($(el)[0]).pause();
185183
});
186184

187-
const activePlaylistItem = container.querySelector(
188-
`.js-video-playlist-item-${state.position}`
189-
);
185+
const activePlaylistItem = container.querySelector(`.js-video-playlist-item-${state.position}`);
190186
if (activePlaylistItem != null)
191187
activePlaylistItem.classList.add('video-playlist__item--active');
192188

@@ -228,9 +224,9 @@ const setupDispatches = (
228224

229225
// #? is this over-kill? should we use Redux?
230226
const reducer = (previousState: State, action: Action): State =>
231-
(reducers[action.type]
227+
reducers[action.type]
232228
? reducers[action.type](previousState)
233-
: previousState);
229+
: previousState;
234230

235231
const createStore = (
236232
storeReducer: (s: State, a: Action) => State,

‎tools/__tasks__/compile/fonts/index.js‎

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,35 @@ const mimeTypes = {
1919

2020
const typeFaces = require('./index.config');
2121

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()})`;
2628

2729
const generateCSS = (fontFamily, font) =>
2830
readFile(path.resolve(src, 'fonts', `${font.src}`), 'base64')
2931
.then(data =>
30-
postcss([perfectionist({ format: 'compressed' })]).process(
31-
`
32+
postcss([perfectionist({ format: 'compressed' })]).process(`
3233
@font-face {
3334
font-family: ${fontFamily};
3435
src: ${toDataURI(font.src, data)};
3536
${[
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('')}
4549
}
46-
`
47-
)
50+
`)
4851
)
4952
.then(result => result.css);
5053

‎tools/__tasks__/compile/hash/index.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ module.exports = {
2828
.sync('**/!(*.map)', { nodir: true, cwd: target })
2929
.reduce((map, assetPath) => {
3030
const assetLocation = path.resolve(target, assetPath);
31-
const hasSourceMap = fs.existsSync(
32-
`${assetLocation}.map`
33-
);
31+
const hasSourceMap = fs.existsSync(`${assetLocation}.map`);
3432

3533
// webpack bundles come pre-hashed, so we won't hash them, just add them
3634
if (webpackRegex.test(assetPath)) {

‎tools/__tasks__/validate/javascript.js‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@ const chalk = require('chalk');
33
const config = '--quiet --color';
44

55
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')}`);
1210
};
1311

1412
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')}`);
1815
};
1916

2017
module.exports = {

‎tools/amp-validation/fetch-page.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ const once = require('lodash/once');
55
const fetch = options => {
66
const onError = once(error => {
77
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}`);
119
}
1210
throw error;
1311
});

‎tools/amp-validation/run.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ const checkEndpoints = (endpoints, options) => validatorFilePath =>
7070
const results = partition(values, Boolean);
7171
const exitValue = results[1].length ? 1 : 0; // every promise returns true <=> exit value is zero
7272

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.`);
7674
validatorJs.cleanUp();
7775
process.exit(exitValue);
7876
});

‎tools/asset-monitor/index.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ const analyse = filePath => {
6666
.then(() => cloudwatch.log(path.basename(filePath), data))
6767
.then(msg => {
6868
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}`)
7270
);
7371
return true;
7472
})

‎tools/es5to6.js‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,25 @@ git
7777
})
7878
.catch(e => {
7979
console.log(chalk.red(e.stack));
80-
megalog.error(
81-
`\`${step}\` did not complete.
80+
megalog.error(`\`${step}\` did not complete.
8281
8382
Once you have fixed the problem, you'll need to run the remaining steps manually:
8483
${Object.keys(steps)
85-
.slice(i)
86-
.map((remaingStep, remainingCount) => `
84+
.slice(i)
85+
.map((remaingStep, remainingCount) => `
8786
${i + 1 + remainingCount}. ${remaingStep}
8887
\`${steps[remaingStep]}\`
8988
`)
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\``);
9391
process.exit(1);
9492
});
9593
}),
9694
Promise.resolve()
9795
)
9896
.then(() => {
9997
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.`)
10399
);
104100
console.log(chalk.dim(`New location: ${es6Module}\n`));
105101
});

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL