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
[UI] feat: Setup prettier and moved lint-staged to its own file #8827
Conversation
Signed-off-by: Antonette Caldwell <acald.nebula@gmail.com>
Passing run #1271 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
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.
The lint changes looks good. Since, I am not aware of the motivation behind due to lack of availability, I would comment less. But the new config looks good.
"react/jsx-filename-extension" : [ | ||
plugins: ['react', 'cypress', 'prettier'], | ||
rules: { | ||
'@next/next/no-img-element': '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.
@nebula-aac All looks good though I have a question should be doing same for meshery cloud as we are not using next Image there too, and getting bunch of lint error on that or we should not silence it?
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.
@Yashsharma1911 I have it turned off now because in using Image from Next, it requires the width and height to be used, and some of the images we have, we're doing without. It would be a good idea to turn it off in Meshery Cloud too.
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.
@Yashsharma1911 can you approve again? I updated the lint staged to fix the linting at commits
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.
Sure
Signed-off-by: Antonette Caldwell <134739862+nebula-aac@users.noreply.github.com>
Signed-off-by: Antonette Caldwell <134739862+nebula-aac@users.noreply.github.com>
Signed-off-by: Antonette Caldwell <134739862+nebula-aac@users.noreply.github.com>
tabWidth: 2 - nice. |
|
||
> **NOTE:** Its strongly recommended to use either [Node Version Manager](https://github.com/nvm-sh/nvm#node-version-manager---) in linux/mac os systems or [NVM for Windows](https://github.com/coreybutler/nvm-windows#nvm-for-windows) on Windows systems so single `nvm use` / `nvm install` simplifies installing and using correct node version locallly **(v18)**, see [NVM Intro](https://github.com/nvm-sh/nvm#intro) for details. Otherwise, you might experience issues during local `npm i` similar to [4674](https://github.com/meshery/meshery/issues/4674) due to how optional dependencies are resolved in npm v6. | ||
|
||
> **NOTE:** Please run the steps in order to avoid issues, as Meshery server should be running and logged-in before accessing the development server |
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.
Could we please have these notes added to one or more of the contributing docs on docs.meshery.io?
Updates needed in:
What instructions do we have or preconfigured settings can we share for popular IDEs like VSCode? |
I can create a separate PR for this. At this time, VS Code will pick up whatever settings is in the prettier config, but depending on the existing setup, it may get confusing. So we may need additional configs to sure this works properly and lessen confusion. Probably by way of using VSCode settings. |
Notes for Reviewers
This PR fixes #8661
Here is the proposed
prettier
config, where some of the existing formatting rules ineslint
can be migrated to allow Prettier format the files for you.I'm testing other rules, and may have removed something that you feel that it should be in the current config.
Please note that in order for this rules to work, you need to use
next lint
instead ofeslint
to lint the files, becauseeslint
andnext lint
works differently from each other.The
lint-staged
has been moved to its own config file for clarity and also takes care linting and formatting with the scripts available.Feedback is welcomed, and this PR is by no means the definite PR, this can be improved with the configs.
Signed commits