guardian/eslint-config-typescript v11#14659
Merged
Conversation
It now requires curly braces, which have been added where needed in this change using `--fix`. This also resulted in some small changes to how types are defined in a few places.
The supported TypeScript version is now 5.5.2. Running `--fix` resulted in one change, replacing the expression: ``` foo && foo.includes(...) ? true : false ``` with: ``` foo?.includes(...) ? true : false ``` This also fixes a warning about an unsupported TypeScript version when running ESLint.
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
Base automatically changed from
guardian-eslint-config-typescript-v10
to
main
October 13, 2025 12:23
JamieB-gu
commented
Oct 13, 2025
Comment on lines
+331
to
+335
| const isDatawrapperGraphic = url?.includes( | ||
| 'interactive.guim.co.uk/datawrapper', | ||
| ) | ||
| ? true | ||
| : false; |
Contributor
Author
There was a problem hiding this comment.
I think the result of the expression should be the same. Technically the behaviour changes slightly in the empty string ('') case. The previous behaviour:
''is falsy'' && ''.includes(...)evaluates to'', skipping theincludes- That's coerced to
false - The ternary condition is
false, so it returnsfalse
Now:
''is neitherundefinedornull- Optional chaining doesn't short circuit, so
includesis evaluated ''doesn't include the string being tested for, so the result isfalse- The ternary condition is
false, so it returnsfalse
As in practice the empty string will not include either the string being tested here, or the one in the scriptUrlIsBoot expression below, there should be no change in functionality.
Does that sound correct @RikRootsGuardian ? I believe it was your change that introduced these expressions originally?
DanielCliftonGuardian
approved these changes
Oct 14, 2025
|
Seen on PROD (merged by @JamieB-gu 8 minutes ago) Please check your changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The supported TypeScript version is now 5.5.2. Running
--fixresulted in two changes, which involve replacing expressions like this:with:
This also fixes a warning about an unsupported TypeScript version when running ESLint.
Release notes: https://github.com/guardian/csnx/releases/tag/%40guardian%2Feslint-config-typescript%4011.0.0
Note: This is opened against #14658 until that's merged.