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(format): use eslint as the formatting tool #1797

Merged
merged 4 commits into from
Nov 4, 2024
Merged

Conversation

Red-Asuka
Copy link
Member

This pull request includes several updates to the apps/cli package, focusing on code refactoring, configuration changes, and dependency updates. The most important changes include refactoring functions to use the function keyword, updating import paths, and modifying configuration files to improve code formatting and linting.

Code Refactoring:

  • Refactored various functions in apps/cli/src/lib/conn.ts, apps/cli/src/lib/ls.ts, and apps/cli/src/lib/pub.ts to use the function keyword instead of arrow functions for better readability and consistency. [1] [2] [3]
  • Updated import paths to use node: prefix for core modules in apps/cli/src/lib/ls.ts and added type imports for better type checking and performance. [1] [2]

Configuration Changes:

  • Removed .prettierrc.json file, indicating a switch to using ESLint for formatting.
  • Updated .vscode/settings.json to disable Prettier, enable ESLint for various languages, and customize ESLint rules to silence stylistic warnings while still auto-fixing them.

Dependency Updates:

  • Added @mqttx/tsconfig and @types/mqttx as workspace dependencies in apps/cli/package.json.

Other Changes:

  • Reordered and restructured import statements in apps/cli/src/index.ts and apps/cli/src/lib/pub.ts for better organization and readability. [1] [2]

These changes aim to improve the codebase's maintainability, readability, and consistency across the project.

@Red-Asuka Red-Asuka added refactor Refactor code or architecture chore Changes in build tools or dependent packages labels Nov 4, 2024
@Red-Asuka Red-Asuka added this to the v2.0.0-alpha.1 milestone Nov 4, 2024
@Red-Asuka Red-Asuka self-assigned this Nov 4, 2024
apps/cli/bin/index.js Outdated Show resolved Hide resolved
apps/cli/src/lib/conn.ts Outdated Show resolved Hide resolved
@ysfscream ysfscream merged commit a7060bc into dev/2.0.0 Nov 4, 2024
6 checks passed
@ysfscream ysfscream deleted the lyd/2.0.0 branch November 4, 2024 08:08
@ysfscream
Copy link
Member

I have some thoughts and suggestions for the optimization of ESLint. I don't want overly strict rules to exist. Of course, excellent lint will make code more readable and understandable and enhance development efficiency.

However, if there are too many rules or destructive rules, it will cause many troubles for developers. Therefore, I want to find a balance point in the middle to meet the requirements, but don't overly pursue "perfection".

@Red-Asuka
Copy link
Member Author

I have some thoughts and suggestions for the optimization of ESLint. I don't want overly strict rules to exist. Of course, excellent lint will make code more readable and understandable and enhance development efficiency.

However, if there are too many rules or destructive rules, it will cause many troubles for developers. Therefore, I want to find a balance point in the middle to meet the requirements, but don't overly pursue "perfection".

Certainly, there is much to discuss regarding the optimization of ESLint. I completely agree that finding the right balance in rule-setting is essential. The complexity of ESLint sometimes draws criticism, but importantly, most errors can be automatically fixed upon saving the file. Additionally, adhering to certain recommended practices can indeed enhance the robustness and maintainability of the code. We need to continue discussing and adjusting to ensure the rules are neither too strict nor too lenient, thereby helping developers to efficiently write higher-quality code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes in build tools or dependent packages refactor Refactor code or architecture
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants