Skip to content

Conversation

@jeremyfelt
Copy link
Member

What?

Remove the fixable configuration on i18n-no-flanking-whitespace

Why?

Auto-fixing flanking whitespace inside translation strings can lead to unintended regressions when those translations are joined with other strings. These should be marked as errors, but left to be addressed manually.

Example:

__( 'Edit or update ', 'my-project' ) + documentName

Reads as "Edit or update document name" before applying a fix and "Edit or updatedocument name" after applying a fix.

The complexities of the fixer were discussed a bit on the original PR here: #38225 (comment)

How?

  • Remove the fixable configuration option
  • Remove the fixer function

Auto-fixing flanking whitespace inside translation strings can
lead to unintended regressions when those translations are
joined with other strings. These should be marked as errors,
but left to be addressed manually.

Example:

```
__( 'Edit or update ', 'my-project' ) + documentName
```

Reads as "Edit or update document name" before applying a fix and
"Edit or updatedocument name" after applying a fix.

The complexities of the fixer were discussed a bit on the original
PR here: WordPress#38225 (comment)
@jeremyfelt jeremyfelt added the [Tool] ESLint plugin /packages/eslint-plugin label May 30, 2025
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jeremyfelt <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Do not expect auto-fixed output when running tests
@jeremyfelt jeremyfelt added the [Type] Bug An existing feature does not function as intended label Jun 11, 2025
@jeremyfelt
Copy link
Member Author

Related, in a similar issue/PR in WPCS WordPress/WordPress-Coding-Standards#2501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] ESLint plugin /packages/eslint-plugin [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant