ScratchAddons
ScratchAddons copied to clipboard
Add package.json with ESLint and Prettier as dev dependencies
Summary
This PR adds package.json with ESLint and Prettier as development dependencies, along with npm scripts for linting and formatting, and improved VSCode settings for better developer experience.
Changes
- ✅ Created
package.jsonwith ESLint, Prettier, and required dependencies - ✅ Added npm scripts for common tasks:
npm run lint- Run ESLintnpm run lint:fix- Auto-fix ESLint issuesnpm run format- Format with Prettiernpm run format:check- Check Prettier formatting
- ✅ Updated
.vscode/settings.jsonwith:- Format on save enabled
- ESLint auto-fix on save
- Prettier as default formatter
- ✅ Specified Node.js >= 18 and npm >= 9 requirements
Benefits
- 🎯 Ensures all contributors use the same linting and formatting tools
- 🚀 Makes it easier for new contributors to set up their development environment
- ✨ Improves code quality and consistency across the codebase
- 🔧 Enables automated checks in CI/CD pipelines (future enhancement)
Testing
- ✅
npm install- Successfully installed dependencies - ✅
npm run lint- Runs without errors - ✅
npm run format:check- Detects formatting differences in existing code (as expected)
Notes
- This PR does not reformat existing code to avoid massive diffs
- The tools will work for new code and future changes
- If maintainers want to format all existing code, that can be done in a separate PR
Related Issues
- Addresses the need mentioned in #6721 (Coding experience checklist)
- Related to #6440 (Potential additions to
.vscodedirectory)
Checklist
- [x] Tested locally
- [x] npm scripts work correctly
- [x] VSCode integration works
- [x] No breaking changes to existing workflow
(I'm Japanese, so I used AI to help with some of the English wording.)
There are already GitHub actions for Prettier formatting and ESLint validation although that one currently does not not apply the changes automaticlly.
Closing this preventively, unless PR author proves they know what they know what Scratch is