implement-js
Installation
SKILL.md
When implementing JavaScript code, follow these guidelines.
Code format guide:
-
Use tabs and double quotes for strings
-
Make sure to follow style guide from eslint or/and editorconfig if present in the project
-
Use Common.JS syntax for imports and exports
-
I do not like to use this format
const { recordEvent } = require("./event-log");, instead, do thisconst recordEvent = require("./event-log").recordEvent; -
Write exports directly in
module.exports = {}; -
Expose constants at the top of the file, after imports, for easier configuration
-
Use JSDoc when function parameters are ambiguous (e.g., options objects with multiple properties)
-
Prefer if/else over ternaries for non-trivial logic - readability over cleverness