Skip to content

Commit

Permalink
Update ESLint configuration for process.env
Browse files Browse the repository at this point in the history
  • Loading branch information
textbook committed Sep 16, 2024
1 parent edace18 commit 2fe92fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion api/utils/config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-syntax */
const { join, resolve } = require("node:path");

const { configDotenv } = require("dotenv");
Expand Down
8 changes: 7 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,20 @@ export default [
files: ["api/**"],
rules: {
"no-console": "warn",
},
},
{
files: ["api/**"],
rules: {
"no-restricted-syntax": [
"warn",
{
selector: "MemberExpression[object.name=process][property.name=env]",
message: "process.env should only be accessed in utils/config.js",
message: "process.env should only be accessed in utils/config.cjs",
},
],
},
ignores: ["api/utils/config.cjs"],
},
{
files: ["**/*.cjs"],
Expand Down

0 comments on commit 2fe92fc

Please sign in to comment.