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

Fix prettier and update to eslint-plugin-svelte #1621

Merged
merged 10 commits into from
Sep 13, 2023

Conversation

rossedfort
Copy link
Contributor

@rossedfort rossedfort commented Sep 7, 2023

Description & motivation 💭

  • replace eslint-plugin-svelte3 (deprecated) with eslint-plugin-svelte, install svelte-eslint-parser and update .eslintrc.cjs with necessary changes
  • install prettier-plugin-svelte, update prettier-plugin-tailwindcss and prettier, and fix prettier scripts in package.json
  • separate eslint/prettier/stylelint into their own npm scripts, and compose them for easier usage
  • add "eslint.validate" to .vscode/settings.json to enable format on save (may require a restart of VSCode)
  • add "source.organizeImports": true to "editor.codeActionsOnSave" in .vscode/settings.json to auto sort imports
  • format all the files

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@rossedfort rossedfort requested review from stevekinney and a team as code owners September 7, 2023 21:22
@vercel
Copy link

vercel bot commented Sep 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storybook ❌ Failed (Inspect) Sep 13, 2023 6:00pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
holocene ⬜️ Ignored (Inspect) Visit Preview Sep 13, 2023 6:00pm

@vercel vercel bot temporarily deployed to Preview – storybook September 7, 2023 21:24 Inactive
Comment on lines +55 to +57
"lint": "pnpm prettier; pnpm eslint; pnpm stylelint",
"lint:ci": "pnpm prettier && pnpm eslint && pnpm stylelint",
"format": "pnpm prettier:fix; pnpm eslint:fix; pnpm stylelint:fix",
Copy link
Contributor Author

@rossedfort rossedfort Sep 7, 2023

Choose a reason for hiding this comment

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

using ; in lint (which should be run locally) will ensure all three are still run even if one fails. Using && in lint:ci will fail our lint GitHub action if one of the individual scripts fails.

@vercel vercel bot temporarily deployed to Preview – storybook September 7, 2023 21:32 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook September 7, 2023 21:34 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook September 7, 2023 21:42 Inactive
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
varsIgnorePattern: '^_|^\\$\\$(Props|Events|Slots)$',
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 needed for when there's a (type|interface) $$Props = {} (or $$Events or $$Slots) in a svelte component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -52,12 +36,16 @@ module.exports = {
es2017: true,
node: true,
},
globals: {
App: 'readonly',
$$Generic: 'readonly',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed for

type T = $$Generic;

interface $$Props {
  myProp: T;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rossedfort rossedfort changed the title make prettier and eslint play nice Fix prettier and update to eslint-plugin-svelte Sep 7, 2023
@vercel vercel bot temporarily deployed to Preview – storybook September 8, 2023 19:26 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook September 8, 2023 19:28 Inactive
@Alex-Tideman Alex-Tideman changed the base branch from main to codefreeze-09.12 September 12, 2023 15:12
@vercel vercel bot temporarily deployed to Preview – storybook September 12, 2023 15:26 Inactive
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"svelte.svelte-vscode"
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty TypeScript Errors might be a nice one to add here as well

Suggested change
"svelte.svelte-vscode"
"svelte.svelte-vscode",
"yoavbls.pretty-ts-errors"

@@ -52,12 +36,16 @@ module.exports = {
es2017: true,
node: true,
},
globals: {
App: 'readonly',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just "the fix" now? Or do we want to leave that "Temporary fix, see the following:" note in there in case there is an actually fix at some point?

Also, just want to confirm we don't want NetworkError and NextPageToken there anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we don't need those anymore cause they are our types and we aren't referencing them globally anymore, i.e. we're importing them wherever they're needed.

And good call, I'll add a comment to the issue I linked in other comments in this PR

@vercel vercel bot temporarily deployed to Preview – storybook September 13, 2023 18:00 Inactive
@rossedfort rossedfort merged commit 282e9a9 into codefreeze-09.12 Sep 13, 2023
5 of 6 checks passed
@rossedfort rossedfort deleted the prettier-eslint-fix branch September 13, 2023 20:01
Alex-Tideman added a commit that referenced this pull request Sep 25, 2023
* Fix prettier and update to eslint-plugin-svelte (#1621)

* make prettier and eslint play nice

* add lint:ci so will fail in ci

* format all the files

* organize imports on save

* update snaps from tailwind class order changes

* update snaps

* add recommended extensions

* pr feedback

* Add codefreeze branch regex to actions (#1636)

* CodeMirror for CodeBlock (#1635)

* Use CodeMirror for event history payloads

* Add readonly prop

* WIP: add copy icon to copy content in JSONEditor

* Make codemirror the new CodeBlock. Need to figure out string new lines and how to update editor on content changes

* Add folding, make string the type for content, update styles, make dynamic, remove PRISM

* Fix extra stringifying

* Fix small issues

* Remove null check

* Use margin

* Fix CodeBlock testid

* Add editable class to codeblock

* Fix playwright payload tests, better extension logic to prevent lineWrapping on inline codeblocks

* Make it more readable, add back storageState

* [DT-1360] Updates to ExecutionStatus filter (#1641)

* Reset filter when closing ExecutionStatus menu and remove Apply button

* Add All option

* Add Caller-Type to http headers, allow in ui-server, update tests (#1634)

* Fix button so that it can't accept an `href` prop if disabled (#1642)

* fix button types so `disabled` can't be used with `href`

* fix schedules page buttons

* upgrade cypress to v13.2.0 and associated changes

* upgrade cypress github action to v6

* prettierignore cypress/downloads

---------

Co-authored-by: Ross Edfort <rossedfort@gmail.com>
Co-authored-by: Laura Whitaker <laura.whitaker@temporal.io>
Alex-Tideman added a commit that referenced this pull request Oct 17, 2023
* Fix prettier and update to eslint-plugin-svelte (#1621)

* make prettier and eslint play nice

* add lint:ci so will fail in ci

* format all the files

* organize imports on save

* update snaps from tailwind class order changes

* update snaps

* add recommended extensions

* pr feedback

* Add codefreeze branch regex to actions (#1636)

* CodeMirror for CodeBlock (#1635)

* Use CodeMirror for event history payloads

* Add readonly prop

* WIP: add copy icon to copy content in JSONEditor

* Make codemirror the new CodeBlock. Need to figure out string new lines and how to update editor on content changes

* Add folding, make string the type for content, update styles, make dynamic, remove PRISM

* Fix extra stringifying

* Fix small issues

* Remove null check

* Use margin

* Fix CodeBlock testid

* Add editable class to codeblock

* Fix playwright payload tests, better extension logic to prevent lineWrapping on inline codeblocks

* Make it more readable, add back storageState

* WIP: get decoding working on expand

* Show the full payloadable, add to input and results

* Clean up all the functions

* Use onMount instead

* Try to check the hash

* Remove blakejs

* Add cloneAllPotentialPayloadsWithCodec fn

* Show null values

* Delete all the port code, fix all tests and types and linting

* Remove console.log

* Don't add check, always use payloads key

* Remove console.log and add key block on json navigator

* Remove port test

* Refactor fetchAllEvents to the workflow-history-layout. Fix timeline issue with json. Add loading to timeline

* Add back loading check for empty row

---------

Co-authored-by: Ross Edfort <rossedfort@gmail.com>
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.

3 participants