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

[PROPOSAL] format opensearch-js code base via eslint+prettier #243

Closed
ananzh opened this issue May 23, 2022 · 0 comments · Fixed by #242
Closed

[PROPOSAL] format opensearch-js code base via eslint+prettier #243

ananzh opened this issue May 23, 2022 · 0 comments · Fixed by #242

Comments

@ananzh
Copy link
Member

ananzh commented May 23, 2022

What kind of business use case are you trying to solve? What are your requirements?

Currently, opensearch-js uses Standard JS as lint check. But it seems not work very well. For example, it misses eslint:no-dupe-else-if and eslint:no-unused-vars and some trivial formats. More research: I checked standard rules here . In 16.x (can’t find 16.0.3 from a quick research), it does not contain eslint:no-dupe-else-if but it does contain eslint:no-unused-vars. I think these two are not trivial checks.

What is the problem? What is preventing you from meeting the requirements?
Standard JS not working well

What are you proposing? What do you suggest we do to solve the problem or improve the existing situation?
I am proposing to change from standard JS to eslint+prettier to make the lint function and make it a bit restrict for future maintain and test purpose.

What are your assumptions or prerequisites?
NA

What are remaining open questions?
NA

ananzh added a commit to ananzh/opensearch-js-1 that referenced this issue May 23, 2022
* add prettier and apply prettier
* add eslint and its config; apply eslint
* modify package.json script
* turn off no-unused-vars and no-dupe-else-if. will fix them
in separate PRs
* modify workflow to run yarn lint for restricter format check
* remove standard

Issue Resolved:
opensearch-project#243

Signed-off-by: Anan Zhuang <[email protected]>
ananzh added a commit to ananzh/opensearch-js-1 that referenced this issue May 24, 2022
* add prettier and apply prettier
* add eslint and its config; apply eslint
* modify package.json script
* turn off no-unused-vars and no-dupe-else-if. will fix them
in separate PRs
* modify workflow to run yarn lint for restricter format check
* remove standard

Issue Resolved:
opensearch-project#243

Signed-off-by: Anan Zhuang <[email protected]>

remove yarn from devDependency and add it as engine

Signed-off-by: Ubuntu <[email protected]>

fix merge conflict

Signed-off-by: Anan Zhuang <[email protected]>
@ananzh ananzh closed this as completed in 9f137e9 May 24, 2022
@kavilla kavilla linked a pull request May 26, 2022 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant