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.
@@ -10,6 +14,7 @@ Every time you choose to apply a rule(s), explicitly state the rule(s) in the ou
10
14
- Part of the API strives to be a polyfill of the Node.js `{crypto}` module.
11
15
- When in doubt, favor in order: WebCrypto API, NodeJS implementation, 0.x implementation
12
16
- 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.
17
+
- NodeJS code has the `deps/ncrypto` library where they are externalizing cryptography code using OpenSSL from the main guts of Node. Try to use this before anything else when adding new features and/or troubleshooting. It may still need upgrading to OpenSSL 3.3+
13
18
14
19
## Tech Stack
15
20
@@ -19,39 +24,11 @@ Every time you choose to apply a rule(s), explicitly state the rule(s) in the ou
19
24
- C++ 20 and higher, modern
20
25
- OpenSSL 3.3 and higher
21
26
- TypeScript package manager is `bun` 1.2 or higher
22
-
- Don't ask to run tests. They have to be run in an example React Native app.
23
27
24
28
## Rules
25
29
26
-
- Use smart pointers in C++.
27
-
- Use modern C++ features.
28
30
- Attempt to reduce the amount of code rather than add more.
29
31
- Prefer iteration and modularization over code duplication.
30
32
- Do not add comments unless explicitly told to do so, or the code is sufficiently complex to warrant comments.
33
+
- Don't ask to run tests. They have to be run in an example React Native app.
31
34
32
-
## TypeScript Best Practices
33
-
34
-
- Use TypeScript for all code; prefer interfaces over types.
35
-
- Use lowercase with dashes for directories (e.g., `components/auth-wizard`).
36
-
- Favor named exports for components.
37
-
- Avoid `any` and enums; use explicit types and maps instead.
38
-
- Do not cast to `unknown` and then another type.
39
-
- Use functional components with TypeScript interfaces.
40
-
- Enable strict mode in TypeScript for better type safety.
41
-
- Suggest the optimal implementation considering:
42
-
- Performance impact
43
-
- Maintenance overhead
44
-
- Testing strategy
45
-
- Code examples should follow TypeScript best practices.
46
-
47
-
## React Best Practices
48
-
49
-
- Minimize the use of `useEffect`. They should be a last resort.
50
-
- Use named functions for `useEffect`s with a meaningful function name. Avoid adding unnecessary comments on effect behavior.
51
-
52
-
## Syntax & Formatting
53
-
54
-
- Use the `function` keyword for pure functions.
55
-
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
0 commit comments