-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore(repo): setting up the base for migrating to eslint #12923
Conversation
Please ensure that this PR:
A repository administrator is required to review & merge this change. |
fd289df
to
83db0aa
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #12923 +/- ##
==========================================
+ Coverage 87.97% 87.98% +0.01%
==========================================
Files 664 664
Lines 18187 18187
Branches 3647 3647
==========================================
+ Hits 16000 16002 +2
+ Misses 2187 2185 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -1,251 +0,0 @@ | |||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
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.
🔥
6b7cc95
to
7783301
Compare
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.
This looks great Hui 🙏 Thank you
7783301
to
d2e910c
Compare
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.
Good stuff! Few questions below
d2e910c
to
95c7d88
Compare
95c7d88
to
3486736
Compare
"formattingToggle.affects": [ | ||
"editor.codeActionsOnSave.source.fixAll.eslint", | ||
"editor.formatOnPaste", | ||
"editor.formatOnSave", | ||
"editor.formatOnType" | ||
] |
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.
This feels a bit restrictive/opinionated, what is the context of this addition?
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.
This is not restrictive, IMO, but gives the most freedom.
- reformat on save is not enabled by default
- ppl who are using vscode can install the recommended extension formatting toggle to enable reformat on save (this is the existing set up prior to this migration)
- for ppl who are not using auto reformat at all, they will catch formatting issues when run
yarn test
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.
Got it, misread these as enforced
}, | ||
], | ||
'valid-typeof': ['error', { requireStringLiterals: false }], | ||
'@stylistic/comma-dangle': [ |
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.
This reads as something that Prettier could just handle?
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.
Prettier handles this (when it actually reformats), this rule is for showing errors with the eslint in details.
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.
Feels extraneous IMO but do not have a strong opinion
'plugin:import/typescript', | ||
'plugin:@typescript-eslint/stylistic', | ||
'plugin:@typescript-eslint/recommended', | ||
"plugin:prettier/recommended", |
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.
Would be careful with usage of "plugin:prettier/recommended"
. Mixing linting with formatting can lead to undesired conflicts
'import/order': ['error', { 'newlines-between': 'always' }], | ||
'no-eval': 'error', | ||
'no-param-reassign': 'error', | ||
'no-shadow': 'off', |
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.
Definitely an opinion, but turning off no-shadow
can lead to code that is difficult to grok as a reader
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.
Just saw that this is turned off in favor of the @typescript-eslint
version 😅
For future maintainers, might be helpful to note which rules are superseded by corresponding @typescript-eslint
rules
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.
Left some thoughts/questions mostly from my own battles with configuring eslint
.
Definitely an improvement overall, and also plan on using some of these in the UI repo 😏
3486736
to
05644e2
Compare
- move the base tsconfig into the root of the workspace - unifying tsconfig tsconfig.build tsconfig.test and tsconfig.watch settings
- remove unused build.js script
05644e2
to
d047026
Compare
Description of changes
See each the commit message of each commit.
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.