About spatie-javascript
A coding skill for applying Spatie's JavaScript and TypeScript conventions, including Vue files and Prettier configuration. It guides developers through selecting relevant rules from a reference document.
Key features
- 01JavaScript and TypeScript style guidance
- 02Vue single-file component rules
- 03Prettier configuration guidance
- 04Rules for naming and functions
- 05Strict equality and destructuring guidance
Use cases
- 01Applying consistent rules to JavaScript changes
- 02Reviewing TypeScript or Vue code
- 03Configuring Prettier for a project
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ spatie/ guidelines-skills --skill spatie-javascriptAfter installing, type/spatie-javascriptin Claude Code to confirm it loaded.
Bundled filesreferences/spatie-javascript-guidelines.md
Details
From the project READMESpatie 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.vuefiles. - Activate this skill when configuring Prettier for a project.
Scope
- In scope: JavaScript, TypeScript, Vue single-file components, Prettier configuration.
- Out of scope: PHP, Laravel, CSS-only files, server configuration.
Workflow
- Identify the JavaScript, TypeScript, Vue, or Prettier artifact being changed.
- Read
references/spatie-javascript-guidelines.mdand focus on the relevant sections. - Apply Prettier configuration first, then the language rules relevant to the change.
Core Rules (Summary)
- Use four-space indentation, a 120-character print width, and single quotes.
- Prefer
const, useletonly for reassignment, and never usevar. - Avoid abbreviated variable names except in clear single-line arrow functions.
- Always use strict equality and cast values before comparing different types.
- Use
functionfor declarations and arrow functions for anonymous or terse functions when appropriate. - Keep functions pure, limit
this, and use shorthand object methods. - Prefer object and array destructuring.
References
references/spatie-javascript-guidelines.md
Comments
Markdown supported