-
Notifications
You must be signed in to change notification settings - Fork 280
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: adds import/order eslint rule to demo-store template #895
Conversation
@@ -10,4 +10,38 @@ module.exports = { | |||
'no-useless-escape': 'off', | |||
'no-case-declarations': 'off', | |||
}, | |||
overrides: [ | |||
{ | |||
files: ['./templates/demo-store/*'], |
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 was included to ensure that the pre-commit scripts for eslint used the correct import/order
definition since the lint configuration at the root of the monorepo will be used for the eslint check.
7dcf57e
to
aa96bc6
Compare
@@ -0,0 +1 @@ | |||
declare module 'typographic-base'; |
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 module has no types, but was somehow passing the typecheck
CI step previously. Not entirely sure how that was possible, but this resolves that issue 👍
Here is the failed CI run for those curious
This is awesome, thanks @QuintonC. Does import order impact the Skeleton template? I recall your suggested order matching this. |
Not just yet -- I'm planning on addressing other templates after this one. I wanted to tackle them one at a time to prevent from having an extremely large pull request 😅 |
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.
Looks great, thanks!
One thing before we merge - can you add a patch changeset for the demo-store? We're keeping track of changes to the demo-store and using changesets to do it. Thanks!
Absolutely. Thanks! |
aa96bc6
to
2dcbaa3
Compare
WHY are these changes introduced?
For the demo-store:
@typescript-eslint/consistent-type-imports
rule.@remix-run/eslint-config
package is installed inpackage.json
, but was not being used in the eslint configuration.Regarding
import/order
additions:import/order
is considered a Shopify best practice and is introduced here to reiterate and lean on that. shopify/web-configs/esnextWHAT is this pull request doing?
This pull request adds import/order eslint rules for the demo-store as a start. Instead of adding it for the entire repository in one pull request, it makes the most sense to import this in smaller chunks.
To address the lint violations, a simple
npm run lint --fix
was used. There were only three additional issues which remained:Addressing those violations saw the following changes:
utils.ts 3:1
($locale).account.tsx
interface Account
was updated tointerface AccountType
. Casted types were updated to reflect this change.($locale).products.$productHandle.tsx
HOW to test your changes?
Post-merge steps
Checklist
I've added a changeset if this PR contains user-facing or noteworthy changesI've added tests to cover my changesI've added or updated the documentation