-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy path.windsurfrules
More file actions
36 lines (30 loc) · 1.8 KB
/
.windsurfrules
File metadata and controls
36 lines (30 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# NOTEPLAN PLUGINS DEVELOPMENT GUIDE
## Build/Test Commands
- Build plugin: `npm run build <plugin-name>` or `npm run build:minified`
- Lint code: `npm run lint` or fix issues with `npm run lint-fix`
- Type check: `npm run typecheck`
- Run a test: `jest <test-file> --no-watch`
## Code Style Guidelines
- Use Flow for static typing
- No semicolons (enforced by ESLint/Prettier)
- Single quotes for strings
- Max line length: 180 characters
- Use template literals instead of string concatenation
- Use ES6+ features (const/let, arrow functions)
- Use async/await and handle promises properly (no floating promises)
- Follow existing naming patterns in the codebase
- Proper error handling with try/catch blocks
- Follow import order: external libs -> internal libs -> local files
- Keep code DRY and modular with clear function responsibilities
- Use JSDoc comments for public functions
## Common Helper Functions
The most frequently used functions in the codebase are:
- Logging: logDebug, logError, clo, logInfo, logWarn
- Note utilities: findNote, getParagraphs, getSelectedParagraphs, getTasksFromNote
- Date handling: getTodaysDateHyphenated, getDateStringFromCalendarFilename
- Configuration: getSettings, updateSettingsForPlugin
- UI interaction: showMessage, showMessageYesNo, displayTitle
When developing, check the helpers/ directory for existing utility functions before writing your own.
For JS/TS, please provide Flow (as appropriate) and JSDOC with all responses. If you are rewriting a full file, make sure to include all import statements also. Do not remove any console.logs or comments (or logDebug, clo, logInfo, logError statements).
**DO NOT EVER HARD-CODE JEST WORKAROUNDS INTO FUNCTIONS WE ARE TESTING**
When you run jest tests, always include the flag --no-watch at the end because my jest config by default watches