Loading...
Loading...
Apply Spatie's JavaScript coding standards for any task that creates, edits, reviews, refactors, or formats JavaScript or TypeScript code; use for variable declarations, comparisons, functions, destructuring, and Prettier configuration to align with Spatie's JS conventions.
npx skill4agent add spatie/guidelines-skills spatie-javascript.js.ts.jsx.tsx.vue.editorconfigconstletletvarconst// Good — full names in multi-line functions
function saveUserSession(userSession) {
// ...
}
// Acceptable — short name in single-line arrow
userSessions.forEach(s => saveUserSession(s));=====const number = parseInt(input);
if (number === 5) {
// ...
}functionthis// Good
const obj = {
handleClick(event) {
// ...
},
};
// Avoid
const obj = {
handleClick: function(event) {
// ...
},
};// Good
const [hours, minutes] = '12:00'.split(':');
// Good — configuration objects with defaults
function createUser({ name, email, role = 'member' }) {
// ...
}
// Avoid
const parts = '12:00'.split(':');
const hours = parts[0];
const minutes = parts[1];