-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Update to ESlint 9 and flat config #4358
Conversation
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-12-26 15:27:21 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks! I had a few questions but more for clarification for me - feel free to merge!
@@ -20,7 +20,7 @@ export const RESEARCH_AND_WRITING_DEFAULT_HEADING = "Research & Writing" | |||
* https://docs.google.com/spreadsheets/d/abcd1234 | |||
*/ | |||
export const gdocUrlRegex = | |||
/https:\/\/docs\.google\.com\/document(?:\/u\/\d)?\/d\/([\-\w]+)\/?(edit)?(\?tab=[\w\.]+)?#?/ | |||
/https:\/\/docs\.google\.com\/document(?:\/u\/\d)?\/d\/([-\w]+)\/?(edit)?(\?tab=[\w.]+)?#?/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the regex edits in this PR are fine as is but this one is semantically differen, no? \.
is not the same as .
- or am I missing something? It doesn't matter much in this case, but just for consistency :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESlint is convinced that escaping .
in brackets is unnecessary, and it seems to be correct:
/[\.]/.test("abc")
false
/[.]/.test("abc")
false
/\./.test("abc")
false
/./.test("abc")
true
@@ -436,14 +436,15 @@ export class StackedDiscreteBarChart | |||
case SortBy.entityName: | |||
sortByFunc = (item: Item): string => item.entityName | |||
break | |||
case SortBy.column: | |||
case SortBy.column: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason why you added these braces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because of the no-case-declarations rule.
@@ -128,9 +128,9 @@ function extractSchemaRecursive( | |||
// then do not emit anything directly and recurse over the | |||
// described properties | |||
if ( | |||
schema.hasOwnProperty("type") && | |||
Object.prototype.hasOwnProperty.call(schema, "type") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because of the no-prototype-builtins rule.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Since React 17 we no longer need to import React for JSX transforms. Running this codemod: * Removes all unused React imports as a result of upgrading to the new JSX transform. * Changes all default React imports (i.e. import React from "react") to destructured named imports (ex. import { useState } from "react") which is the preferred style going into the future. These cannot be separated, even though we now only needed to remove the unused imports.
npx react-codemod update-react-imports
and fix the no longer necessary hack to suppress warning aboutuseLayoutEffect
when server side rendering, see the commit for more context.eslintrc.yaml
config files, since nested dir configs are no longer supported, and move the same config for those directories into the maineslint.config.mjs
fileI tried switching to the new
projectService
config option fortypescript-eslint
, and it was much slower than the oldproject
option, so I kept the old one.