Skip to content

Commit

Permalink
Ensure process.env use is centralised
Browse files Browse the repository at this point in the history
  • Loading branch information
textbook committed Jan 10, 2024
1 parent 0bdb32c commit ca5c6d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
}
],
"rules": {
"no-console": "warn"
"no-console": "warn",
"no-restricted-syntax": [
"warn",
{
"selector": "MemberExpression[object.name=process][property.name=env]",
"message": "process.env should only be accessed in utils/config.js"
}
]
}
}
1 change: 1 addition & 0 deletions server/utils/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-restricted-syntax */
import "dotenv/config";

export default {
Expand Down

0 comments on commit ca5c6d0

Please sign in to comment.