Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
testdino-hq avatar

Javascript

  • 2 installs
  • 8 repo stars
  • Updated February 25, 2026
  • testdino-hq/google-styleguides-skills

Applies Google's official ES6+ JavaScript style guide for const/let, arrow functions, modules, naming, and JSDoc.

About

Google's official JavaScript style guide for ES6+ covering const/let, arrow functions, template literals, destructuring, modules, and JSDoc. A developer uses it to write and review modern, consistent JavaScript.

  • Google's official ES6+ JavaScript style guide
  • Covers const/let, arrow functions, modules, JSDoc, and naming

Javascript by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #1,862 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/testdino-hq/google-styleguides-skills --skill javascript

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars8
Last updatedFebruary 25, 2026
Repositorytestdino-hq/google-styleguides-skills

What it does

Applies Google's official ES6+ JavaScript style guide for const/let, arrow functions, modules, naming, and JSDoc.

Files

SKILL.mdMarkdownGitHub ↗

Google JavaScript Style Guide

Official Google JavaScript coding standards for ES6+ code.

Golden Rules

1. Use `const` by defaultlet only when reassignment needed, never var 2. Arrow functions for callbacks — traditional functions for methods 3. Template literals for string interpolation 4. Destructuring where it improves readability 5. Named exports over default exports 6. JSDoc for public APIs — document parameters and return types 7. 2-space indentation — consistent formatting

Quick Reference

Naming Conventions

ElementConventionExample
ClassesUpperCamelCaseUserService
Functions/MethodslowerCamelCasegetUserById
VariableslowerCamelCaseuserCount
ConstantsUPPER_SNAKE_CASEMAX_SIZE
Private fields#privateField#userId
Fileslower-kebab-caseuser-service.js

Variables

// ✓ CORRECT
const greeting = 'Hello';
let count = 0;

// ✗ INCORRECT
var greeting = 'Hello';  // never use var

Functions

// ✓ CORRECT - arrow functions for callbacks
const double = (x) => x * 2;
array.map(item => item.id);

// ✓ CORRECT - traditional functions for methods
class User {
  getName() {
    return this.name;
  }
}

// ✓ CORRECT - default parameters
function greet(name, greeting = 'Hello') {
  return `${greeting}, ${name}!`;
}

Strings

// ✓ CORRECT - template literals
const name = 'Alice';
const greeting = `Hello, ${name}!`;

// ✗ INCORRECT
const greeting = 'Hello, ' + name + '!';

Destructuring

// ✓ CORRECT - object destructuring
const {id, name} = user;
const {x, y, ...rest} = coordinates;

// ✓ CORRECT - array destructuring
const [first, second] = items;
const [head, ...tail] = list;

// ✓ CORRECT - function parameters
function processUser({id, name, email}) {
  // ...
}

Modules

// ✓ CORRECT - named exports
export function myFunction() { /* ... */ }
export class MyClass { /* ... */ }

// ✓ CORRECT - named imports
import {myFunction, MyClass} from './my-module.js';

// ✗ INCORRECT - default exports (avoid)
export default function() { /* ... */ }

Classes

// ✓ CORRECT
class Animal {
  #name;  // private field

  constructor(name) {
    this.#name = name;
  }

  speak() {
    return `${this.#name} makes a sound.`;
  }
}

JSDoc

/**
 * Fetches user data from the API.
 * @param {number} userId - The user ID to fetch.
 * @param {Object} options - Optional configuration.
 * @param {number} options.timeout - Request timeout in ms.
 * @return {Promise<Object>} The user data.
 */
function fetchUser(userId, {timeout = 5000} = {}) {
  // ...
}

Promises and Async/Await

// ✓ CORRECT - async/await
async function fetchUser(id) {
  const response = await fetch(`/api/users/${id}`);
  if (!response.ok) {
    throw new Error(`HTTP error: ${response.status}`);
  }
  return response.json();
}

// ✓ CORRECT - error handling
try {
  const user = await fetchUser(1);
} catch (error) {
  console.error('Failed to fetch user:', error);
}

Common Mistakes

MistakeCorrect Approach
Using varUse const / let
String concatenationUse template literals
Default exportsUse named exports
Missing JSDocDocument public APIs
Traditional functions for callbacksUse arrow functions
Ignoring destructuringUse where it helps readability

When to Use This Guide

  • Writing new JavaScript code
  • Refactoring existing JavaScript
  • Code reviews
  • Setting up ESLint rules
  • Onboarding new team members

Install

npx skills add testdino-hq/google-styleguides-skills/javascript

Full Guide

See javascript.md for complete details, examples, and edge cases.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.