Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Add @wordpress/i18n-no-flanking-whitespace rule #11868

Merged
merged 5 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
"eslint-comments/no-unused-disable": "error",
"eslint-comments/require-description": "error",
"@wordpress/dependency-group": "error",
"@wordpress/i18n-no-flanking-whitespace": "error",
"@wordpress/no-unused-vars-before-return": ["error", {
"excludePattern": "^use"
}],
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/translateToExclusiveList.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function translateToExclusiveList(options) {
__('%1$s, or %2$s', 'web-stories'),
options.slice(0, options.length - 1).join(
/* translators: delimiter used in a list */
__(', ', 'web-stories')
__(', ', 'web-stories') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace -- Expected behaviour.
),
options[options.length - 1]
);
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/translateToInclusiveList.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function translateToInclusiveList(options) {
__('%1$s, and %2$s', 'web-stories'),
options.slice(0, options.length - 1).join(
/* translators: delimiter used in a list */
__(', ', 'web-stories')
__(', ', 'web-stories') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace -- Expected behaviour.
),
options[options.length - 1]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function MediaRecordingLayer() {

showSnackbar({
message: __(
' There was an error taking a photo. Please try again.',
'There was an error taking a photo. Please try again.',
'web-stories'
),
dismissable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,11 @@ function DeleteDialog({ mediaId, type, onClose }) {
const imageDialogTitle = __('Delete Image?', 'web-stories');
const videoDialogTitle = __('Delete Video?', 'web-stories');
const imageDialogDescription = __(
'You are about to permanently delete this image from your site. ' +
'The image will appear broken in any content that uses it. ',
'You are about to permanently delete this image from your site. The image will appear broken in any content that uses it.',
'web-stories'
);
const videoDialogDescription = __(
'You are about to permanently delete this video from your site. ' +
'The video will appear broken in any content that uses it. ',
'You are about to permanently delete this video from your site. The video will appear broken in any content that uses it.',
'web-stories'
);

Expand Down