You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output You can abbreviate the rule description to a single word or phrase.
3
+
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
4
4
5
5
## Project Context
6
-
- This is a react native project that offers cryptographic operations in native
7
-
code.
6
+
7
+
- This is a React Native project that offers cryptographic operations in native code.
8
8
- It uses Nitro Modules to bridge JS & C++.
9
-
- Use the documentation of Nitro Modules if you have access locally to its llms.txt file.
10
-
- Part of the API strives to be a polyfill of the Node.js {crypto} module.
9
+
- Use the documentation of Nitro Modules if you have access locally to its `llms.txt` file.
10
+
- Part of the API strives to be a polyfill of the Node.js `{crypto}` module.
11
11
- The goal is to migrate 0.x of this library that uses OpenSSL 1.1.1 to now use OpenSSL 3.3 and modern C++ with Nitro Modules.
12
12
13
13
## Tech Stack
14
+
14
15
- React Native
15
-
- Typescript
16
+
- TypeScript
16
17
- Nitro Modules
17
18
- C++ 20 and higher, modern
18
19
- OpenSSL 3.3 and higher
19
20
- TypeScript package manager is `bun` 1.2 or higher
20
-
- don't ask to run tests. They have to be run in an example React Native app.
21
+
- Don't ask to run tests. They have to be run in an example React Native app.
21
22
22
23
## Rules
23
-
- for C++ includes, do not try to add absolute or relative paths. They have to be resolved by the build system.
24
-
- use smart pointers in C++
25
-
- use modern C++ features
24
+
25
+
- For C++ includes, do not try to add absolute or relative paths. They have to be resolved by the build system.
26
+
- Use smart pointers in C++.
27
+
- Use modern C++ features.
26
28
- Attempt to reduce the amount of code rather than add more.
27
29
- Prefer iteration and modularization over code duplication.
28
30
29
-
# TypeScript Best Practices
31
+
## TypeScript Best Practices
30
32
31
33
- Use TypeScript for all code; prefer interfaces over types.
32
-
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
34
+
- Use lowercase with dashes for directories (e.g., `components/auth-wizard`).
33
35
- Favor named exports for components.
34
-
- Avoid any and enums; use explicit types and maps instead.
36
+
- Avoid `any` and enums; use explicit types and maps instead.
35
37
- Use functional components with TypeScript interfaces.
36
38
- Enable strict mode in TypeScript for better type safety.
37
39
- Suggest the optimal implementation considering:
38
40
- Performance impact
39
41
- Maintenance overhead
40
42
- Testing strategy
41
-
- Code examples should follow Typescript best practices.
43
+
- Code examples should follow TypeScript best practices.
42
44
43
-
# React Best Practices
45
+
## React Best Practices
44
46
45
-
- Minimize the use of useEffect. They should be a last resort.
46
-
- Use named functions for useEffects with a meaningful function name. Avoiding adding unnecessary comments on effect behavior.
47
+
- Minimize the use of `useEffect`. They should be a last resort.
48
+
- Use named functions for `useEffect`s with a meaningful function name. Avoid adding unnecessary comments on effect behavior.
47
49
48
-
# Syntax & Formatting
50
+
## Syntax & Formatting
49
51
50
-
- Use the function keyword for pure functions.
52
+
- Use the `function` keyword for pure functions.
51
53
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
0 commit comments