Skip to content

Commit e1db9a2

Browse files
Use arrow functions in docs site shortcode exports
1 parent 7fa2442 commit e1db9a2

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

apps/pie-docs/src/_11ty/shortcodes/contentPageImage.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ const createCaption = (config) => (config.caption
2424
* @param {string} config.variant - Sets the variant of the shortcut. Valid values are default, secondary and inverse. Defaults to "default"
2525
* @returns {string} a <figure> element containing the image(s) provided with the config settings applied.
2626
*/
27-
// eslint-disable-next-line func-names
28-
module.exports = function (config) {
27+
module.exports = (config) => {
2928
const context = config.context ?? 'contentPage';
3029
const contextClass = `c-${context}-img`;
3130
const isImageFullContainerWidth = !config.width;

apps/pie-docs/src/_11ty/shortcodes/indexPageDisplay.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ const getUrl = (element) => {
3838
return element.url;
3939
};
4040

41-
module.exports = function ({
41+
module.exports = ({
4242
collection,
4343
itemKey,
4444
excludedElements,
4545
imageSrcDirectory,
46-
}) {
46+
}) => {
4747
const menuItems = find(collection, itemKey);
4848
const draftPages = getDraftPagesList(collection);
4949

apps/pie-docs/src/_11ty/shortcodes/notification.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ const notificationSettings = {
4545
* @param {string} config.iconName - The name of the icon to use for the Notification".
4646
* @returns {string}
4747
*/
48-
// eslint-disable-next-line func-names
49-
module.exports = function (config) {
48+
module.exports = (config) => {
5049
const context = config.context ?? 'contentPage';
5150
const contextClass = `c-${context}-notification`;
5251
const iconFill = getNotificationColour(notificationSettings[config.type].iconFill);

apps/pie-docs/src/_11ty/shortcodes/usage.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ const buildUsageCard = (usageType, { type, items, hasPadding = true }) => {
8383
* @param {UsageItem} usage.dont - Information for the "dont" section.
8484
* @returns {string} - The HTML representation of the usage component.
8585
*/
86-
// eslint-disable-next-line func-names
87-
module.exports = function (props) {
88-
return `<div class="c-usage-container">
89-
${Object.keys(metadata).map((usageType) => buildUsageCard(usageType, props[usageType])).join(' ')}
90-
</div>`;
91-
};
86+
module.exports = (props) => `<div class="c-usage-container">
87+
${Object.keys(metadata).map((usageType) => buildUsageCard(usageType, props[usageType])).join(' ')}
88+
</div>`;

0 commit comments

Comments
 (0)