like this:
in my src/tslint.json
{
"extends": "base-tslint.json", //extends another one
"no-any": true,
"prefer-const": false,
}
actually, i'm curious as to why the answer to this Should I have multiple .env files? is No. It seems to go against common practice. As devs we need the flexibility of having env.local, env.staging, etc.
If anyone can elaborate on how else to go about it.
@cjaoude It's in this page linked to from the README: https://12factor.net/config
Because dotenv is just assigning keys that don’t already exist in process.env, you can just call config multiple times.
const dotenv = require(“dotenv”)
[“.env”, “.env.whatever”].forEach(path => dotenv.config({ path }))
@maxbeatty smart idea. But as note that first files take precedence. My version:
// withEnv.js
const dotenv = require('dotenv');
const fs = require('fs');
const path = require('path');
[ '.env.local','.env.development','.env']
.forEach(name => fs.existsSync(path.resolve(__dirname,name)) && dotenv.config({ path: name }) );
And real usage in package.json:
{
"start": "node -r ./withEnv ./node_modules/.bin/react-native start",
}
Most helpful comment
Because dotenv is just assigning keys that don’t already exist in
process.env, you can just callconfigmultiple times.