Skip to content
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

Merged
merged 9 commits into from
Jan 31, 2024

Conversation

HuiSF
Copy link
Contributor

@HuiSF HuiSF commented Jan 29, 2024

Description of changes

See each the commit message of each commit.

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@HuiSF HuiSF requested review from a team as code owners January 29, 2024 20:42
Copy link

⚠️ This PR includes manual changes to the "aws-amplify" package.json file, which can have library-wide implications.

Please ensure that this PR:

  • Does not modify "@aws-amplify/*" dependency versions, which may misalign core dependencies across the library.

A repository administrator is required to review & merge this change.

@HuiSF HuiSF marked this pull request as draft January 29, 2024 20:44
@HuiSF HuiSF force-pushed the hui/chore/repo/migrate-eslint-new branch from fd289df to 83db0aa Compare January 29, 2024 21:03
@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (38c1d56) 87.97% compared to head (95c7d88) 87.98%.

❗ 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     
Flag Coverage Δ
adapter-nextjs 98.64% <ø> (ø)
analytics 62.75% <ø> (ø)
api-graphql 87.71% <ø> (ø)
api-rest 95.95% <ø> (ø)
auth 86.78% <ø> (ø)
aws-amplify 100.00% <ø> (ø)
core 87.72% <ø> (ø)
datastore 89.95% <ø> (+0.04%) ⬆️
datastore-storage-adapter 88.13% <ø> (ø)
geo 90.12% <ø> (ø)
interactions 96.10% <ø> (ø)
notifications 90.35% <ø> (ø)
predictions 86.00% <ø> (ø)
pubsub 94.70% <ø> (ø)
rtn-push-notification 100.00% <ø> (ø)
storage 91.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HuiSF HuiSF marked this pull request as ready for review January 29, 2024 21:15
@@ -1,251 +0,0 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

packages/adapter-nextjs/package.json Outdated Show resolved Hide resolved
@HuiSF HuiSF force-pushed the hui/chore/repo/migrate-eslint-new branch from 6b7cc95 to 7783301 Compare January 29, 2024 23:13
@HuiSF HuiSF requested a review from cshfang January 29, 2024 23:13
ashika112
ashika112 previously approved these changes Jan 30, 2024
Copy link
Contributor

@ashika112 ashika112 left a 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

Copy link
Contributor

@jimblanc jimblanc left a 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

packages/adapter-nextjs/tsconfig.test.json Outdated Show resolved Hide resolved
packages/pubsub/package.json Outdated Show resolved Hide resolved
.eslintrc.js Show resolved Hide resolved
package.json Show resolved Hide resolved
@HuiSF HuiSF force-pushed the hui/chore/repo/migrate-eslint-new branch from d2e910c to 95c7d88 Compare January 30, 2024 16:56
@HuiSF HuiSF requested a review from jimblanc January 30, 2024 16:57
jimblanc
jimblanc previously approved these changes Jan 30, 2024
Comment on lines +7 to +12
"formattingToggle.affects": [
"editor.codeActionsOnSave.source.fixAll.eslint",
"editor.formatOnPaste",
"editor.formatOnSave",
"editor.formatOnType"
]
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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': [
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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",
Copy link
Contributor

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',
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

@calebpollman calebpollman left a 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 😏

@HuiSF HuiSF force-pushed the hui/chore/repo/migrate-eslint-new branch from 3486736 to 05644e2 Compare January 31, 2024 19:01
@HuiSF HuiSF force-pushed the hui/chore/repo/migrate-eslint-new branch from 05644e2 to d047026 Compare January 31, 2024 19:31
@HuiSF HuiSF merged commit b893b0c into main Jan 31, 2024
30 checks passed
@HuiSF HuiSF deleted the hui/chore/repo/migrate-eslint-new branch January 31, 2024 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants