Upgrade eslint and eslint-related packages - #51059
Conversation
| "react/no-danger": "error", | ||
| } | ||
| 'babel/semi': 'error', // autofixable | ||
| 'cdo-custom-rules/style-blocks-below-class': 'error', |
There was a problem hiding this comment.
I see a few rules like this one moved into apps, did that happen as part of the linting or was a conscious choice (I think this one in particular makes sense here b/c its react-specific)?
There was a problem hiding this comment.
Conscious choice I forgot to include in the PR description! 2 reasons: they are all specific to apps (react, babel, mocha tests), and now eslint does package resolution slightly differently, so us referencing the rules in a folder where the packages did not exist (all the eslint packages are installed to /apps) was causing some inconsistent behavior.
sanchitmalhotra126
left a comment
There was a problem hiding this comment.
Awesome! Thanks for documenting all the follow-up tasks!
+1 on the documentation for the follow-up tasks and preliminary investigation into these! Thanks Molly! |
Upgrade of various linting packages:
babel-eslintto@babel/eslint-parser(package name changed)eslinteslint-config-prettiereslint-plugin-babeleslint-plugin-mochaeslint-plugin-prettiereslint-plugin-react-hooksI also added linting packages for typescript, and set up configurations for typescript files in
.eslintrc.js, but have not adding typescript linting toyarn lintyet. That will be done as a follow-up so this PR stays scoped to the various upgrades.I kept our non-typescript files linted with the babel parser, and we will use
@typescript-eslint/parserfor our typescript files. There were a few discrepancies between the two parsers that made it hard to do an easy swap out, and it made sense to me to have typescript-specific parsing for typescript files only. However, we could revisit this if we find it confusing to have two linters (or at least unify rules if we discover major differences).I fixed a few new linter errors that were obviously safe to fix (such as 3 global variables that were not used, and one case of a react hook dependency array that was safe). For the rest, I either added ignores for rules that would need many ignore comments, or adding ignore comments to relevant lines. We will follow up with fixes/investigations for these violations. The categories of violations are:
builtInGlobalsto this rule. I made a task on Student Learning to start investigating this and determine whether to follow the new rule or not.no-async-promise-executor. I think this is a student learning component, here's the follow-up ticket.As part of working on this I ended up linting
.eslintrc.jswith prettier. We actually don't need prettier on that root level, but I left it as-is because it is more consistent with our other javascript files.Links
Testing story
I mostly used drone to validate these changes.
Follow-up work
See the list above for various follow-ups
PR Checklist: