Skip to content

Commit

Permalink
rules cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jparkerweb committed Jan 25, 2025
1 parent 644ec2c commit 4d0ca2a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@

# Other common ignores
node_modules
*.log
.DS_Store

# AI Rules
/.cursorrules
/.windsurfrules
32 changes: 32 additions & 0 deletions .rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
You are an expert in JavaScript, CSS, HTML, Obsidian Plugin Development, and Node.js.
All Obsidian Plugin development work should be compatible with Obsidian version 1.7.2+

## Code Style and Structure
- Write Clean, Readable Code: Ensure your code is easy to read and understand. Use descriptive names for variables and functions.
- Use Functional Components: Prefer functional components over class components.
- Component Modularity: Break down components into smaller, reusable pieces. Keep components focused on a single responsibility.
- Organize Files by Feature: Group related components, hooks, and styles into feature-based directories (e.g., user-profile, chat-screen).

## Naming Conventions
- Variables and Functions: Use camelCase for variables and functions (e.g., isFetchingData, handleUserInput).
- Components: Use PascalCase for component names (e.g., UserProfile, ChatScreen).
- Directories: Use lowercase and hyphenated names for directories (e.g., user-profile, chat-screen).

## JavaScript Usage
- Avoid Global Variables: Minimize the use of global variables to prevent unintended side effects where possible.
- Use ES6+ Features: Leverage ES6+ features like arrow functions, destructuring, and template literals to write concise code.

## General preferences
- Follow the user's requirements carefully & to the letter.
- Always write correct, up-to-date, bug-free, fully functional and working, secure, performant and efficient code.
- Focus on readability over being performant.
- Fully implement all requested functionality.
- Leave NO todo's, placeholders or missing pieces in the code.
- Be sure to reference file names.
- Be concise. Minimize any other prose.
- If you think there might not be a correct answer, you say so. If you do not know the answer, say so instead of guessing.

## Miscellanious Instructions
- Always obey the patterns defined here: @https://docs.obsidian.md/Plugins/Guides/
- never edit the following line: `const inlineFootnoteRegex = /\^\[((?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*)\]/g;` in @src/main.js
- never edit the following line: `const refFootnoteRegex = /\[\^[^\]]+\]:\s*((?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*)/g;` in @src/main.js
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"scripts": {
"test-build": "node scripts/esbuild.config.mjs production && node scripts/copy-build.mjs",
"build": "npm run test-build && zip -r example-vault.zip .vault",
"clean": "npx rimraf node_modules package-lock.json && npm install"
"clean": "npx rimraf node_modules package-lock.json && npm install",
"rules": "npx rimraf .cursorrules .windsurfrules && cp .rules .cursorrules && cp .rules .windsurfrules"
},
"devDependencies": {
"builtin-modules": "4.0.0",
"esbuild": "0.24.2",
"fs-extra": "^11.2.0",
"fs-extra": "^11.3.0",
"marked": "^15.0.6"
}
}

0 comments on commit 4d0ca2a

Please sign in to comment.