JavaScript Cursor Rules
Learn about cursor rules specific to JavaScript development.
JavaScript-Specific Rules
Cursor rules in JavaScript enhance your coding experience by providing smart navigation and manipulation features tailored for JavaScript development.
Code Navigation
- Jump between function declarations and expressions
- Navigate through object properties and methods
- Quick access to import/export statements
Smart Selection
- Select function blocks and arrow functions
- Expand selection to include template literals
- Smart array and object literal selection
Code Manipulation
- Quick method insertion
- Automated template literal handling
- Object property navigation
Best Practices
- Use context-aware navigation for better code understanding
- Leverage function-specific cursor movements
- Utilize object property shortcuts
Examples
// Navigate between function declarations
function greet(name) {
return `Hello, ${name}!`;
}
// Smart selection of arrow functions
const calculate = (a, b) => {
return a + b;
};
// Object property navigation
const config = {
apiKey: 'secret',
endpoint: 'https://api.example.com',
timeout: 5000
};
Configuration
Customize JavaScript-specific cursor rules in your settings:
{
"javascript.cursorRules": {
"functionNavigation": true,
"smartSelection": true,
"objectPropertyHandling": true
}
}