ScratchAddons icon indicating copy to clipboard operation
ScratchAddons copied to clipboard

Add package.json with ESLint and Prettier as dev dependencies

Open k-sry opened this issue 1 month ago • 2 comments

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.json with ESLint, Prettier, and required dependencies
  • ✅ Added npm scripts for common tasks:
    • npm run lint - Run ESLint
    • npm run lint:fix - Auto-fix ESLint issues
    • npm run format - Format with Prettier
    • npm run format:check - Check Prettier formatting
  • ✅ Updated .vscode/settings.json with:
    • 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 .vscode directory)

Checklist

  • [x] Tested locally
  • [x] npm scripts work correctly
  • [x] VSCode integration works
  • [x] No breaking changes to existing workflow

k-sry avatar Nov 18 '25 11:11 k-sry

(I'm Japanese, so I used AI to help with some of the English wording.)

k-sry avatar Nov 18 '25 11:11 k-sry

There are already GitHub actions for Prettier formatting and ESLint validation although that one currently does not not apply the changes automaticlly.

Samq64 avatar Nov 18 '25 14:11 Samq64

Closing this preventively, unless PR author proves they know what they know what Scratch is

WorldLanguages avatar Dec 12 '25 23:12 WorldLanguages