spatie-javascriptlisted
Install: claude install-skill rcdelfin/agentkit
# Spatie JavaScript Guidelines
## Overview
Apply Spatie's JavaScript coding standards to keep JS/TS code consistent and readable.
## When to Activate
- Activate this skill for any JavaScript or TypeScript coding work.
- Activate this skill when working on `.js`, `.ts`, `.jsx`, `.tsx`, or `.vue` files.
- Activate this skill when configuring Prettier or ESLint for a project.
## Scope
- In scope: JavaScript, TypeScript, Vue single-file components, Prettier/ESLint configuration.
- Out of scope: PHP, Laravel, CSS-only files, server configuration.
## Prettier Configuration
- Indentation: 4 spaces (via `.editorconfig`, not Prettier default of 2)
- Print width: 120 characters (not Prettier default of 80)
- Quote style: single quotes
## Variable Declarations
- Prefer `const` over `let`. Only use `let` when a variable will be reassigned.
- Never use `var`.
- Reassigning object properties is fine with `const` — the reference is not reassigned.
## Variable Names
- Don't abbreviate variable names in multi-line functions. Use full, descriptive names.
- Exception: single-line arrow functions where context is obvious.
```javascript
// Good — full names in multi-line functions
function saveUserSession(userSession) {
// ...
}
// Acceptable — short name in single-line arrow
userSessions.forEach(s => saveUserSession(s));
```
## Comparisons
- Always use `===` (strict equality). Never use `==`.
- If unsure of the type, cast it first:
```javascript
const number = parseInt(input