Skip to content

Commit 72c2a72

Browse files
authored
Update prettier to v2 (#567)
* Update prettier to v2 * Automated changes by prettier * Remove renovate override for prettier
1 parent ea5677e commit 72c2a72

18 files changed

Lines changed: 54 additions & 742 deletions

.remarkrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
plugins: ['remark-preset-lint-recommended', 'remark-preset-prettier']
2+
plugins: ['remark-preset-lint-recommended', 'remark-preset-prettier'],
33
};

.storybook/cloud-four-theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export default create({
55

66
brandTitle: 'Cloud Four Patterns',
77
brandUrl: 'https://cloudfour.com',
8-
brandImage: '/logo.svg'
8+
brandImage: '/logo.svg',
99
});

.storybook/main.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ module.exports = {
1717
implementation: require('sass'),
1818
sassOptions: {
1919
// Import Theo design tokens as SCSS variables
20-
importer: [require('./theo-importer')]
21-
}
22-
}
23-
}
20+
importer: [require('./theo-importer')],
21+
},
22+
},
23+
},
2424
},
2525
// Community addons
26-
'storybook-addon-themes'
26+
'storybook-addon-themes',
2727
],
28-
webpackFinal: async config => {
28+
webpackFinal: async (config) => {
2929
// Remove default SVG processing from default config.
3030
// @see https://github.com/storybookjs/storybook/issues/5708#issuecomment-515384927
31-
config.module.rules = config.module.rules.map(data => {
31+
config.module.rules = config.module.rules.map((data) => {
3232
if (/svg\|/.test(String(data.test))) {
3333
data.test = /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani)(\?.*)?$/;
3434
}
@@ -39,20 +39,20 @@ module.exports = {
3939
config.module.rules.push(
4040
{
4141
test: /\.twig$/,
42-
use: 'twigjs-loader'
42+
use: 'twigjs-loader',
4343
},
4444
{
4545
// Import Theo design tokens as JS objects
4646
test: /\.ya?ml$/,
47-
use: resolve(__dirname, './theo-loader.js')
47+
use: resolve(__dirname, './theo-loader.js'),
4848
},
4949
{
5050
// Optimize and process SVGs as React elements for use in documentation
5151
test: /\.svg$/,
52-
use: '@svgr/webpack'
52+
use: '@svgr/webpack',
5353
}
5454
);
5555

5656
return config;
57-
}
57+
},
5858
};

.storybook/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { addons } from '@storybook/addons';
22
import cloudFourTheme from './cloud-four-theme';
33

44
addons.setConfig({
5-
theme: cloudFourTheme
5+
theme: cloudFourTheme,
66
});

.storybook/theo-importer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ function theoImporter(url, prev, done) {
2828
.convert({
2929
transform: {
3030
file: tokenPath,
31-
type: 'web'
31+
type: 'web',
3232
},
3333
format: {
34-
type: 'default.scss' // Variables will have `!default` appended
35-
}
34+
type: 'default.scss', // Variables will have `!default` appended
35+
},
3636
})
37-
.then(scssString => {
37+
.then((scssString) => {
3838
done({ contents: scssString }); // Pass result to Sass
3939
})
4040
.catch(({ message }) => {

.storybook/theo-loader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function theoLoader(source) {
1818
// By processing import paths beforehand, we give Webpack the info it needs
1919
// to refresh files accurately and clear its cache.
2020
if (def.imports) {
21-
def.imports.forEach(importPath => {
21+
def.imports.forEach((importPath) => {
2222
// Import paths are relative to the requesting file.
2323
this.addDependency(resolve(tokenPath, importPath));
2424
});
@@ -28,14 +28,14 @@ function theoLoader(source) {
2828
.convert({
2929
transform: {
3030
file: tokenPath,
31-
type: 'web'
31+
type: 'web',
3232
},
3333
format: {
3434
// Outputs ES modules: `export const propertyName = value;`
35-
type: 'module.js'
36-
}
35+
type: 'module.js',
36+
},
3737
})
38-
.then(result => {
38+
.then((result) => {
3939
done(null, result);
4040
})
4141
.catch(({ message }) => {

gulpfile.js/tasks/svg-to-twig.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const dynamicSvgProps = [
2323
'role',
2424
'style',
2525
'viewBox',
26-
'width'
26+
'width',
2727
];
2828

2929
/**
@@ -46,13 +46,13 @@ function templatizeSvgString(src) {
4646
svg.children = [...prepend.children, ...svg.children, ...append.children];
4747

4848
// Identify props already in use in the SVG versus those yet to be used
49-
const usedProps = dynamicSvgProps.filter(prop => Boolean(svg.attrs[prop]));
50-
const unusedProps = dynamicSvgProps.filter(prop => !svg.attrs[prop]);
49+
const usedProps = dynamicSvgProps.filter((prop) => Boolean(svg.attrs[prop]));
50+
const unusedProps = dynamicSvgProps.filter((prop) => !svg.attrs[prop]);
5151

5252
// Properties already in use should have their value set to a conditional.
5353
// The `default` filter would be less code, but things get tricky when it
5454
// comes to managing quotation marks in XML.
55-
usedProps.forEach(prop => {
55+
usedProps.forEach((prop) => {
5656
const current = svg.attrs[prop];
5757
// Dashes have meaning in Twig expressions, so we replace them with
5858
// underscores in property names.
@@ -69,7 +69,7 @@ function templatizeSvgString(src) {
6969
// We build a big string of attribute name/value pairs for any properties
7070
// yet to be used for this asset.
7171
const unusedPropHtml = unusedProps
72-
.map(prop => {
72+
.map((prop) => {
7373
const twigProp = prop.replace(/-/g, '_');
7474
return `{% if ${twigProp} %} ${prop}="{{${twigProp}}}"{% endif %}`;
7575
})

gulpfile.js/tasks/theo-to-mdx.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ function theoToMdx() {
1313
.pipe(
1414
gulpTheo({
1515
transform: {
16-
type: 'web'
16+
type: 'web',
1717
},
1818
format: {
19-
type: 'stories.mdx'
20-
}
19+
type: 'stories.mdx',
20+
},
2121
})
2222
)
2323
.pipe(dest('src/design-tokens/generated'));

gulpfile.js/tasks/watch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { watch } = require('gulp');
22
const svgToTwig = require('./svg-to-twig');
33
const theoToMdx = require('./theo-to-mdx');
44

5-
module.exports = function() {
5+
module.exports = function () {
66
watch('src/assets/**/*.svg', svgToTwig);
77
watch('src/design-tokens/**/*.yml', theoToMdx);
88
};

gulpfile.js/theo-formats/stories.mdx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function mdxStoriesFormat(result) {
102102
const title = startCase(slug);
103103
const props = result.get('props').toJS();
104104
const categories = groupBy(props, 'category');
105-
const mdxCategories = Object.keys(categories).map(category =>
105+
const mdxCategories = Object.keys(categories).map((category) =>
106106
categoryToMdx(category, categories[category])
107107
);
108108
return `

0 commit comments

Comments
 (0)