AOSSIE-Org / AOSSIE-Org/OrgExplorer
[FEATURE]: Add missing lint and format scripts to package.json
- Ngôn ngữ chính
- JavaScript
- Star
- 34
- Fork
- 92
- Merge trung bình
- 8 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 12
Mô tả
### Feature and its Use Cases
## Is your feature request related to a problem? Please describe.
The `CONTRIBUTING.md` checklist instructs contributors to run `npm run lint` before opening a pull request, but the current `package.json` does not define either a `lint` or `format` script.
Running:
```bash
npm run lint
```
currently results in:
```text
npm ERR! Missing script: "lint"
```
This mismatch creates confusion for new contributors and makes it difficult to maintain consistent code quality across the project.
---
## Describe the solution you'd like
Add standard linting and formatting scripts to `package.json` so contributors can easily run the same checks locally.
### Proposed changes
1. Install ESLint and Prettier as development dependencies:
```bash
npm install -D eslint prettier eslint-config-prettier eslint-plugin-react
```
2. Add the following scripts to `package.json`:
```json
{
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint src/",
"format": "prettier --write src/"
}
}
```
3. Update the ESLint configuration to:
* Extend recommended React rules.
* Disable formatting conflicts with Prettier.
4. Update `CONTRIBUTING.md` so that the checklist correctly references the new scripts.
---
## Describe alternatives you've considered
* **Removing the `npm run lint` reference from `CONTRIBUTING.md`**
This would eliminate the confusion, but it would also reduce code quality standards rather than improve them.
* **Using only Prettier without ESLint**
While Prettier handles formatting, ESLint helps detect potential issues such as unused variables, missing imports, and other code-quality problems that Prettier cannot catch.
---
## Additional context
The repository already contains an `eslint.config.js` file, which suggests that ESLint support has been partially set up. It only lacks the corresponding npm scripts and any missing development dependencies.
Once these changes are added, the `CONTRIBUTING.md` checklist (`npm run lint` passes) will work as intended and provide a smoother onboarding experience for contributors.
### Additional Context
### Code of Conduct
- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates
Hướng dẫn đóng góp
Hướng nghiên cứu
Start by inspecting package.json, the existing eslint.config.js, and CONTRIBUTING.md; then run the current npm scripts to confirm the missing commands. Add the requested development tooling and scripts, align the contributor checklist, and verify that npm run lint and npm run format execute successfully.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- eslint, javascript
- Lĩnh vực
- documentation, tooling
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 62/100