Skip to content

Commit

Permalink
Make specific suggestions for nd functions
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-dbos authored Jan 26, 2024
2 parents 1f0a97e + bf3af1d commit f0e836a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dbos-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const extConfig =
module.exports = {
meta: {
"name": "@dbos-inc/eslint-plugin",
"version": "0.0.4",
"version": "0.0.6",
},
rules: {
'detect-native-code': {
Expand All @@ -92,7 +92,7 @@ module.exports = {
{
context.report({
node: node,
message: "Avoid using the 'bcrypt' library, which contains native code. Instead, use 'bcryptjs'. Also, note that some bcrypt functions generate random data and should only be called from DBOS communicators.",
message: "Avoid using the 'bcrypt' library, which contains native code. Instead, use 'bcryptjs'. Also, note that some bcrypt functions generate random data and should only be called from DBOS communicators, such as `@dbos-inc/communicator-bcrypt`.",
});
}
},
Expand All @@ -118,7 +118,7 @@ module.exports = {
{
context.report({
node: node,
message: 'Avoid calling Math.random() directly; it can lead to non-reproducible behavior.',
message: 'Avoid calling Math.random() directly; it can lead to non-reproducible behavior. See `@dbos-inc/communicator-random`'
});
}
if (node.callee.type === 'Identifier' &&
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports = {
if (node.callee.name === 'Date') {
context.report({
node: node,
message: 'Avoid using new Date(); consider using the DBOS SDK functions for consistency and testability.',
message: 'Avoid using new Date(); consider using the DBOS SDK functions or `@dbos-inc/communicator-datetime` for consistency and testability.',
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dbos-inc/eslint-plugin",
"version": "0.0.5",
"version": "0.0.6",
"description": "eslint plugin for DBOS SDK",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit f0e836a

Please sign in to comment.