-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use convict for env vars (#646)
* feat: add convict as dependency * feat: config wip * feat: add convict schema with defaults and validation * feat: add config alias and update dependencies * feat: replace process.env with config.get (wip) * fix: use import over require * feat: wip to use config * feat: add cloudmersive key as env * feat: wip to use config * feat: update config properties * feat: update imports and use config * chore: update env.test and imports * chore: standardise env * chore: remove dotenv * chore: format eslintrc * fix: rename convict format and env enums * chore: remove DOMAIN_WHITELIST from env * chore: revert trust proxy change * fix: cookie domain to be enums * feat: update to use config * fix: remove checks for env in logic * fix: make gitGuardian optional env * feat: add staging as option for node env * chore(app): chagne to import syntax * fix: remove string coercing for env key * chore: remove check for undefine site create form key env * chore: update package-lock --------- Co-authored-by: seaerchin <jiachin@open.gov.sg>
- Loading branch information
1 parent
3db9533
commit 0ac21de
Showing
50 changed files
with
22,448 additions
and
15,268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,129 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true, | ||
"jest": true, | ||
"jest/globals": true | ||
}, | ||
"extends": [ | ||
"airbnb-base", | ||
"prettier", | ||
"plugin:import/typescript" | ||
], | ||
"plugins": ["only-warn", "import", "jest"], | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"rules": { | ||
"no-underscore-dangle": "off", | ||
"class-methods-use-this": "off", | ||
"import/no-unresolved": "error", | ||
"import/extensions": ["warn", "never"], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
}, | ||
"newlines-between": "always", | ||
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object"], | ||
"pathGroups": [{ | ||
"pattern": "@logger/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@errors/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@middleware/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@classes/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@routes/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@utils/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@validators/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@constants/**", | ||
"group": "internal", | ||
"position": "before" | ||
} | ||
] | ||
} | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true, | ||
"jest": true, | ||
"jest/globals": true | ||
}, | ||
"extends": ["airbnb-base", "prettier", "plugin:import/typescript"], | ||
"plugins": ["only-warn", "import", "jest"], | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"rules": { | ||
"no-underscore-dangle": "off", | ||
"class-methods-use-this": "off", | ||
"import/no-unresolved": "error", | ||
"import/extensions": ["warn", "never"], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
}, | ||
"newlines-between": "always", | ||
"groups": [ | ||
"builtin", | ||
"external", | ||
"internal", | ||
"parent", | ||
"sibling", | ||
"index", | ||
"object" | ||
], | ||
"jest/no-identical-title": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"parser": "@typescript-eslint/parser", | ||
"extends": ["plugin:@typescript-eslint/recommended"] | ||
} | ||
], | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"] | ||
}, | ||
"import/resolver": { | ||
"typescript": { | ||
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` | ||
"alwaysTryTypes": true | ||
}, | ||
"node": { | ||
"paths": ["src"], | ||
"extensions": [".js", ".jsx", ".ts", ".tsx"] | ||
}, | ||
"alias": [ | ||
["@root", "."], | ||
["@classes", "./classes"], | ||
["@errors", "./errors"], | ||
["@logger", "./logger"], | ||
["@middleware", "./middleware"], | ||
["@routes", "./routes"], | ||
["@utils", "./utils"], | ||
["@loaders", "./loaders"], | ||
["@database", "./database"], | ||
["@services", "./services"], | ||
["@validators", "./validators"], | ||
["@fixtures", "./fixtures"], | ||
["@database", "./database"], | ||
["@constants", "./constants"] | ||
] | ||
} | ||
"pathGroups": [ | ||
{ | ||
"pattern": "@config/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@logger/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@errors/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@middleware/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@classes/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@routes/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@utils/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@validators/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@constants/**", | ||
"group": "internal", | ||
"position": "before" | ||
} | ||
] | ||
} | ||
], | ||
"jest/no-identical-title": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"parser": "@typescript-eslint/parser", | ||
"extends": ["plugin:@typescript-eslint/recommended"] | ||
} | ||
], | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"] | ||
}, | ||
"globals": { | ||
"Base64": true | ||
"import/resolver": { | ||
"typescript": { | ||
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` | ||
"alwaysTryTypes": true | ||
}, | ||
"node": { | ||
"paths": ["src"], | ||
"extensions": [".js", ".jsx", ".ts", ".tsx"] | ||
}, | ||
"alias": [ | ||
["@root", "."], | ||
["@config", "./config"], | ||
["@classes", "./classes"], | ||
["@errors", "./errors"], | ||
["@logger", "./logger"], | ||
["@middleware", "./middleware"], | ||
["@routes", "./routes"], | ||
["@utils", "./utils"], | ||
["@loaders", "./loaders"], | ||
["@database", "./database"], | ||
["@services", "./services"], | ||
["@validators", "./validators"], | ||
["@fixtures", "./fixtures"], | ||
["@database", "./database"], | ||
["@constants", "./constants"] | ||
] | ||
} | ||
} | ||
}, | ||
"globals": { | ||
"Base64": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.