Skip to content

Commit a94fde0

Browse files
committed
chore: add ESLint configuration for TypeScript and JavaScript files
- Integrated ESLint with TypeScript support using @typescript-eslint - Configured recommended rules for TypeScript and JavaScript - Added plugins for Jest, Jest Extended, Simple Import Sort, and Prettier - Customized rules for unused variables, empty catch blocks, and variable declarations - Set up global variables for Node, Browser, and Jest environments - Ignored specific directories (dist and coverage) in linting
1 parent cd0aa8e commit a94fde0

File tree

10 files changed

+2234
-2394
lines changed

10 files changed

+2234
-2394
lines changed

.eslintrc.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. See [standa
88

99
### Bug Fixes
1010

11-
- **deps:** fix package exports, default must be last ([100053f](https://github.com/marcocesarato/dotenv-mono/commit/100053f7c589073b1c1ee30159dc6c2055f57e5c))
11+
- **deps:** fix package exports, default must be last ([100053f](https://github.com/marcocesarato/dotenv-mono/commit/100053f7c589073b1c1ee30159dc6c2055f57e5c))
1212

1313
### [1.3.12](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.11...v1.3.12) (2023-09-17)
1414

@@ -18,148 +18,148 @@ All notable changes to this project will be documented in this file. See [standa
1818

1919
### Bug Fixes
2020

21-
- load file fills in the object fields from the loaded file ([62cab2c](https://github.com/marcocesarato/dotenv-mono/commit/62cab2cda4bbc3fc4add736465fc368c610f4b1e))
21+
- load file fills in the object fields from the loaded file ([62cab2c](https://github.com/marcocesarato/dotenv-mono/commit/62cab2cda4bbc3fc4add736465fc368c610f4b1e))
2222

2323
### [1.3.9](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.8...v1.3.9) (2022-12-22)
2424

2525
### Bug Fixes
2626

27-
- add parse option map of number validator on cli ([c606608](https://github.com/marcocesarato/dotenv-mono/commit/c60660834e1b3d0e40bd876df4628ff893d2d67e))
28-
- **deps:** update dependency dotenv-expand to v10 ([c6ef9a6](https://github.com/marcocesarato/dotenv-mono/commit/c6ef9a6f7ae17f54e43f5e06fb4202eeb802e598))
29-
- improve map of numbers parsed option check on cli ([e029e4e](https://github.com/marcocesarato/dotenv-mono/commit/e029e4e5759350ac47634f7a80ec604233969577))
27+
- add parse option map of number validator on cli ([c606608](https://github.com/marcocesarato/dotenv-mono/commit/c60660834e1b3d0e40bd876df4628ff893d2d67e))
28+
- **deps:** update dependency dotenv-expand to v10 ([c6ef9a6](https://github.com/marcocesarato/dotenv-mono/commit/c6ef9a6f7ae17f54e43f5e06fb4202eeb802e598))
29+
- improve map of numbers parsed option check on cli ([e029e4e](https://github.com/marcocesarato/dotenv-mono/commit/e029e4e5759350ac47634f7a80ec604233969577))
3030

3131
### [1.3.8](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.7...v1.3.8) (2022-12-15)
3232

3333
### Bug Fixes
3434

35-
- trim dots on extension config ([0e4fda8](https://github.com/marcocesarato/dotenv-mono/commit/0e4fda87ef8dd9f28bfb81ec0e63b684d92fc8b4))
35+
- trim dots on extension config ([0e4fda8](https://github.com/marcocesarato/dotenv-mono/commit/0e4fda87ef8dd9f28bfb81ec0e63b684d92fc8b4))
3636

3737
### [1.3.7](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.6...v1.3.7) (2022-12-15)
3838

3939
### [1.3.6](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.5...v1.3.6) (2022-11-30)
4040

4141
### Bug Fixes
4242

43-
- check json value parsed on run cli ([015e454](https://github.com/marcocesarato/dotenv-mono/commit/015e454965e9c32a14971a7a708828981557949e))
44-
- prevent path empty string ([7bd3f59](https://github.com/marcocesarato/dotenv-mono/commit/7bd3f599b13821a4539fd56de852096d26b2ff46))
43+
- check json value parsed on run cli ([015e454](https://github.com/marcocesarato/dotenv-mono/commit/015e454965e9c32a14971a7a708828981557949e))
44+
- prevent path empty string ([7bd3f59](https://github.com/marcocesarato/dotenv-mono/commit/7bd3f599b13821a4539fd56de852096d26b2ff46))
4545

4646
### [1.3.5](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.4...v1.3.5) (2022-11-23)
4747

4848
### Bug Fixes
4949

50-
- os eol saving ([2a1fd6d](https://github.com/marcocesarato/dotenv-mono/commit/2a1fd6d0fad42ea2a13f22f7cecb5394a33df731))
50+
- os eol saving ([2a1fd6d](https://github.com/marcocesarato/dotenv-mono/commit/2a1fd6d0fad42ea2a13f22f7cecb5394a33df731))
5151

5252
### [1.3.4](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.3...v1.3.4) (2022-11-23)
5353

5454
### Bug Fixes
5555

56-
- cli argv parameters parsing ([037d338](https://github.com/marcocesarato/dotenv-mono/commit/037d33875b0466b039cf67744eb660ad7b3b9448))
57-
- save changes on empty dotenv ([b76948d](https://github.com/marcocesarato/dotenv-mono/commit/b76948d375d537b7865263529e67bf80a68af3b3))
56+
- cli argv parameters parsing ([037d338](https://github.com/marcocesarato/dotenv-mono/commit/037d33875b0466b039cf67744eb660ad7b3b9448))
57+
- save changes on empty dotenv ([b76948d](https://github.com/marcocesarato/dotenv-mono/commit/b76948d375d537b7865263529e67bf80a68af3b3))
5858

5959
### [1.3.3](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.2...v1.3.3) (2022-11-23)
6060

6161
### Bug Fixes
6262

63-
- save changes on dotenv file matching ([b07850fe](https://github.com/marcocesarato/dotenv-mono/commit/b07850fea6ede63b52b03ac59ccedf0855915548))
64-
- add run cli return value ([d61cc1d0](https://github.com/marcocesarato/dotenv-mono/commit/d61cc1d0cba54bbdb83c5057fc2c306be61df8be))
65-
- get priorities with environment on run ([32efc79d](https://github.com/marcocesarato/dotenv-mono/commit/32efc79d01ab27b693ee3f4b42ce585d37e42156))
63+
- save changes on dotenv file matching ([b07850fe](https://github.com/marcocesarato/dotenv-mono/commit/b07850fea6ede63b52b03ac59ccedf0855915548))
64+
- add run cli return value ([d61cc1d0](https://github.com/marcocesarato/dotenv-mono/commit/d61cc1d0cba54bbdb83c5057fc2c306be61df8be))
65+
- get priorities with environment on run ([32efc79d](https://github.com/marcocesarato/dotenv-mono/commit/32efc79d01ab27b693ee3f4b42ce585d37e42156))
6666

6767
### [1.3.2](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.1...v1.3.2) (2022-11-22)
6868

6969
### Bug Fixes
7070

71-
- parse typing ([81ccfbd](https://github.com/marcocesarato/dotenv-mono/commit/81ccfbd1e1496f15c978e02f9382c24e61a4bca5))
71+
- parse typing ([81ccfbd](https://github.com/marcocesarato/dotenv-mono/commit/81ccfbd1e1496f15c978e02f9382c24e61a4bca5))
7272

7373
### [1.3.1](https://github.com/marcocesarato/dotenv-mono/compare/v1.3.0...v1.3.1) (2022-11-22)
7474

7575
### Bug Fixes
7676

77-
- add encoding string typing and casting ([f583e53](https://github.com/marcocesarato/dotenv-mono/commit/f583e53969c0a2e77f1441ce6d1b10b3f247cb71))
78-
- improve cli option parsing and type detection ([b77d9fa](https://github.com/marcocesarato/dotenv-mono/commit/b77d9fafc6c64bc413b501a4fa6fd6e895ec58f5))
77+
- add encoding string typing and casting ([f583e53](https://github.com/marcocesarato/dotenv-mono/commit/f583e53969c0a2e77f1441ce6d1b10b3f247cb71))
78+
- improve cli option parsing and type detection ([b77d9fa](https://github.com/marcocesarato/dotenv-mono/commit/b77d9fafc6c64bc413b501a4fa6fd6e895ec58f5))
7979

8080
## [1.3.0](https://github.com/marcocesarato/dotenv-mono/compare/v1.2.0...v1.3.0) (2022-11-22)
8181

8282
### Features
8383

84-
- add file to load dotenv files with require ([c27232b](https://github.com/marcocesarato/dotenv-mono/commit/c27232b28e9bc901ca1d0037a83f01f47718c232)), closes [#2](https://github.com/marcocesarato/dotenv-mono/issues/2)
85-
- add options as parameters on cli usage method ([3b23fc2](https://github.com/marcocesarato/dotenv-mono/commit/3b23fc2367c700337a1dc3fc0e400a192f9f0802))
84+
- add file to load dotenv files with require ([c27232b](https://github.com/marcocesarato/dotenv-mono/commit/c27232b28e9bc901ca1d0037a83f01f47718c232)), closes [#2](https://github.com/marcocesarato/dotenv-mono/issues/2)
85+
- add options as parameters on cli usage method ([3b23fc2](https://github.com/marcocesarato/dotenv-mono/commit/3b23fc2367c700337a1dc3fc0e400a192f9f0802))
8686

8787
## [1.2.0](https://github.com/marcocesarato/dotenv-mono/compare/v1.1.4...v1.2.0) (2022-11-22)
8888

8989
### Features
9090

91-
- add defaults dotenv config and matcher ([b2c9028](https://github.com/marcocesarato/dotenv-mono/commit/b2c902838a763b3fb935b7a17b12f22c528ce8bd))
92-
- load defaults dotenv file ([479ecf4](https://github.com/marcocesarato/dotenv-mono/commit/479ecf4de274cbdaf1f51f5cec2e213e7b0fdaaf))
91+
- add defaults dotenv config and matcher ([b2c9028](https://github.com/marcocesarato/dotenv-mono/commit/b2c902838a763b3fb935b7a17b12f22c528ce8bd))
92+
- load defaults dotenv file ([479ecf4](https://github.com/marcocesarato/dotenv-mono/commit/479ecf4de274cbdaf1f51f5cec2e213e7b0fdaaf))
9393

9494
### Bug Fixes
9595

96-
- load dotenv on process with defaults ([e379f2d](https://github.com/marcocesarato/dotenv-mono/commit/e379f2d7b559b07fececcfd0d2587bf6cb2260ec))
96+
- load dotenv on process with defaults ([e379f2d](https://github.com/marcocesarato/dotenv-mono/commit/e379f2d7b559b07fececcfd0d2587bf6cb2260ec))
9797

9898
### [1.1.4](https://github.com/marcocesarato/dotenv-mono/compare/v1.1.3...v1.1.4) (2022-11-19)
9999

100100
### Bug Fixes
101101

102-
- add config props nullable ([62393f0](https://github.com/marcocesarato/dotenv-mono/commit/62393f04a45d30081351bb0bd5d56f0f7c72a2d5))
102+
- add config props nullable ([62393f0](https://github.com/marcocesarato/dotenv-mono/commit/62393f04a45d30081351bb0bd5d56f0f7c72a2d5))
103103

104104
### [1.1.3](https://github.com/marcocesarato/dotenv-mono/compare/v1.1.2...v1.1.3) (2022-11-18)
105105

106106
### Bug Fixes
107107

108-
- typo repo name in homepage and bug url of package.json ([413c3c4](https://github.com/marcocesarato/dotenv-mono/commit/413c3c4930da44d99c30f2d6decccdba0a605f0a))
109-
- add export default dotenv class ([9bfed27](https://github.com/marcocesarato/dotenv-mono/commit/9bfed27850cd0756636c09244f9df8dd363b84ca))
110-
- set accessor properties as private ([afd4df8](https://github.com/marcocesarato/dotenv-mono/commit/afd4df83892510ef13e81052c78269808c880634))
108+
- typo repo name in homepage and bug url of package.json ([413c3c4](https://github.com/marcocesarato/dotenv-mono/commit/413c3c4930da44d99c30f2d6decccdba0a605f0a))
109+
- add export default dotenv class ([9bfed27](https://github.com/marcocesarato/dotenv-mono/commit/9bfed27850cd0756636c09244f9df8dd363b84ca))
110+
- set accessor properties as private ([afd4df8](https://github.com/marcocesarato/dotenv-mono/commit/afd4df83892510ef13e81052c78269808c880634))
111111

112112
### [1.1.2](https://github.com/marcocesarato/dotenv-mono/compare/v1.1.1...v1.1.2) (2022-11-18)
113113

114114
### Bug Fixes
115115

116-
- add explicit typing on shortcut functions ([2abe7ff](https://github.com/marcocesarato/dotenv-mono/commit/2abe7ffeee1e54169a6c0d255e19539b4b41bafa))
116+
- add explicit typing on shortcut functions ([2abe7ff](https://github.com/marcocesarato/dotenv-mono/commit/2abe7ffeee1e54169a6c0d255e19539b4b41bafa))
117117

118118
### [1.1.1](https://github.com/marcocesarato/dotenv-mono/compare/v1.1.0...v1.1.1) (2022-11-14)
119119

120120
### Docs
121121

122-
- improve priorities documentation
122+
- improve priorities documentation
123123

124124
## [1.1.0](https://github.com/marcocesarato/dotenv-mono/compare/v1.0.1...v1.1.0) (2022-11-12)
125125

126126
### Features
127127

128-
- add load and config shortcuts ([38677e9](https://github.com/marcocesarato/dotenv-mono/commit/38677e98b6b14d6f891014ea87fcb6f2faa2c718))
128+
- add load and config shortcuts ([38677e9](https://github.com/marcocesarato/dotenv-mono/commit/38677e98b6b14d6f891014ea87fcb6f2faa2c718))
129129

130130
### [1.0.1](https://github.com/marcocesarato/dotenv-mono/compare/v1.0.0...v1.0.1) (2022-11-11)
131131

132132
### Bug Fixes
133133

134-
- path file configuration ([4b02d66](https://github.com/marcocesarato/dotenv-mono/commit/4b02d6634ee275bb64a54bf43ae06723649de84e))
134+
- path file configuration ([4b02d66](https://github.com/marcocesarato/dotenv-mono/commit/4b02d6634ee275bb64a54bf43ae06723649de84e))
135135

136136
## [1.0.0](https://github.com/marcocesarato/dotenv-mono/compare/v0.2.0...v1.0.0) (2022-11-11)
137137

138138
### Bug Fixes
139139

140-
- cwd not undefined ([191e0eb](https://github.com/marcocesarato/dotenv-mono/commit/191e0ebd0e0c23bcfc4c649de41fcadbf78f7b73))
140+
- cwd not undefined ([191e0eb](https://github.com/marcocesarato/dotenv-mono/commit/191e0ebd0e0c23bcfc4c649de41fcadbf78f7b73))
141141

142142
## [0.2.0](https://github.com/marcocesarato/dotenv-mono/compare/v0.1.2...v0.2.0) (2022-11-11)
143143

144144
### Features
145145

146-
- add encoding, override and debug config ([4707aac](https://github.com/marcocesarato/dotenv-mono/commit/4707aac17131743a3577e973f73d3e247b76c276))
147-
- add parse method ([6e9800d](https://github.com/marcocesarato/dotenv-mono/commit/6e9800d0964044e700cfa204e8d8f7f6fa2749b3))
146+
- add encoding, override and debug config ([4707aac](https://github.com/marcocesarato/dotenv-mono/commit/4707aac17131743a3577e973f73d3e247b76c276))
147+
- add parse method ([6e9800d](https://github.com/marcocesarato/dotenv-mono/commit/6e9800d0964044e700cfa204e8d8f7f6fa2749b3))
148148

149149
### [0.1.2](https://github.com/marcocesarato/dotenv-mono/compare/v0.1.1...v0.1.2) (2022-11-11)
150150

151151
### Features
152152

153-
- add cwd and depth config ([4343ac2](https://github.com/marcocesarato/dotenv-mono/commit/4343ac2320431b9ff5853d3047b1ea972a29932d))
153+
- add cwd and depth config ([4343ac2](https://github.com/marcocesarato/dotenv-mono/commit/4343ac2320431b9ff5853d3047b1ea972a29932d))
154154

155155
### Bug Fixes
156156

157-
- improve code compatibility ([e0f5b16](https://github.com/marcocesarato/dotenv-mono/commit/e0f5b165a1f4a16bc196f1433ac1bea9ff93599f))
157+
- improve code compatibility ([e0f5b16](https://github.com/marcocesarato/dotenv-mono/commit/e0f5b165a1f4a16bc196f1433ac1bea9ff93599f))
158158

159159
### [0.1.1](https://github.com/marcocesarato/dotenv-mono/compare/v0.1.0...v0.1.1) (2022-11-10)
160160

161161
### Bug Fixes
162162

163-
- default priority ([892948e](https://github.com/marcocesarato/dotenv-mono/commit/892948e2a944af98a217f888ede1fbbe1d9d9960))
163+
- default priority ([892948e](https://github.com/marcocesarato/dotenv-mono/commit/892948e2a944af98a217f888ede1fbbe1d9d9960))
164164

165165
## 0.1.0 (2022-11-10)

eslint.config.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
const js = require("@eslint/js");
2+
const globals = require("globals");
3+
const tsPlugin = require("@typescript-eslint/eslint-plugin");
4+
const tsParser = require("@typescript-eslint/parser");
5+
6+
module.exports = [
7+
js.configs.recommended,
8+
{
9+
files: ["**/*.ts"],
10+
languageOptions: {
11+
parser: tsParser,
12+
parserOptions: {
13+
sourceType: "module",
14+
ecmaVersion: "latest",
15+
project: "./tsconfig.json",
16+
},
17+
globals: {
18+
...globals.node,
19+
...globals.browser,
20+
...globals.jest,
21+
},
22+
},
23+
plugins: {
24+
"@typescript-eslint": tsPlugin,
25+
jest: require("eslint-plugin-jest"),
26+
"jest-extended": require("eslint-plugin-jest-extended"),
27+
"simple-import-sort": require("eslint-plugin-simple-import-sort"),
28+
prettier: require("eslint-plugin-prettier"),
29+
},
30+
rules: {
31+
...tsPlugin.configs.recommended.rules,
32+
"prettier/prettier": "error",
33+
"no-var": "warn",
34+
"prefer-const": "warn",
35+
"no-unused-vars": "off",
36+
"@typescript-eslint/no-unused-vars": [
37+
"error",
38+
{
39+
"argsIgnorePattern": "^_",
40+
"varsIgnorePattern": "^_",
41+
"ignoreRestSiblings": true,
42+
},
43+
],
44+
"no-undef": "off", // TypeScript handles this
45+
"no-empty": ["error", {"allowEmptyCatch": true}],
46+
},
47+
},
48+
{
49+
files: ["**/*.js"],
50+
languageOptions: {
51+
globals: {
52+
...globals.node,
53+
...globals.browser,
54+
...globals.jest,
55+
},
56+
},
57+
plugins: {
58+
jest: require("eslint-plugin-jest"),
59+
"jest-extended": require("eslint-plugin-jest-extended"),
60+
"simple-import-sort": require("eslint-plugin-simple-import-sort"),
61+
prettier: require("eslint-plugin-prettier"),
62+
},
63+
rules: {
64+
"prettier/prettier": "error",
65+
"no-var": "warn",
66+
"prefer-const": "warn",
67+
},
68+
},
69+
{
70+
ignores: ["**/dist/**/*", "**/coverage/**/*"],
71+
},
72+
];

package.json

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"license": "BSD-2-Clause",
2929
"scripts": {
3030
"release": "standard-version",
31-
"lint": "eslint --ext .js,.ts .",
32-
"lint:fix": "eslint --ext .js,.ts . --fix",
31+
"lint": "eslint .",
32+
"lint:fix": "eslint . --fix",
3333
"format": "prettier --write .",
3434
"build": "tsc",
3535
"tsc": "tsc",
@@ -38,30 +38,31 @@
3838
"coverage": "jest --coverage && start coverage/index.html"
3939
},
4040
"dependencies": {
41-
"dotenv": "^16.4.5",
42-
"dotenv-expand": "^11.0.6"
41+
"dotenv": "^17.2.0",
42+
"dotenv-expand": "^12.0.2"
4343
},
4444
"devDependencies": {
45-
"@types/jest": "^29.5.12",
45+
"@types/jest": "^30.0.0",
4646
"@types/mock-fs": "^4.13.4",
47-
"@types/node": "^20.11.25",
48-
"@typescript-eslint/eslint-plugin": "^7.1.1",
49-
"@typescript-eslint/parser": "^7.1.1",
50-
"eslint": "^8.57.0",
51-
"eslint-config-prettier": "^9.1.0",
52-
"eslint-plugin-jest": "^27.9.0",
53-
"eslint-plugin-jest-extended": "^2.0.0",
54-
"eslint-plugin-prettier": "^5.1.3",
55-
"eslint-plugin-simple-import-sort": "^12.0.0",
56-
"husky": "^9.0.11",
57-
"jest": "^29.7.0",
58-
"jest-extended": "^4.0.2",
59-
"lint-staged": "^15.2.2",
60-
"mock-fs": "^5.2.0",
61-
"prettier": "^3.2.5",
47+
"@types/node": "^24.0.14",
48+
"@typescript-eslint/eslint-plugin": "^8.37.0",
49+
"@typescript-eslint/parser": "^8.37.0",
50+
"eslint": "^9.31.0",
51+
"eslint-config-prettier": "^10.1.5",
52+
"eslint-plugin-jest": "^29.0.1",
53+
"eslint-plugin-jest-extended": "^3.0.0",
54+
"eslint-plugin-prettier": "^5.5.1",
55+
"eslint-plugin-simple-import-sort": "^12.1.1",
56+
"globals": "^16.3.0",
57+
"husky": "^9.1.7",
58+
"jest": "^30.0.4",
59+
"jest-extended": "^6.0.0",
60+
"lint-staged": "^16.1.2",
61+
"mock-fs": "^5.5.0",
62+
"prettier": "^3.6.2",
6263
"standard-version": "^9.5.0",
63-
"ts-jest": "^29.1.2",
64-
"typescript": "^5.4.2"
64+
"ts-jest": "^29.4.0",
65+
"typescript": "^5.8.3"
6566
},
6667
"publishConfig": {
6768
"access": "public"

src/cli.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {OptionType, parseOption, runCli} from "./cli";
22
import {config, Dotenv, load} from "./index";
3+
import {DotenvConfigOutput} from "dotenv";
34
import mockFs from "mock-fs";
45

56
describe("Run CLI", () => {
@@ -26,25 +27,25 @@ describe("Run CLI", () => {
2627
});
2728

2829
it("should return the expected output", () => {
29-
const dotenv = runCli(load);
30+
const dotenv = runCli(load) as Dotenv;
3031
expect(dotenv instanceof Dotenv).toBeTruthy();
3132
expect(dotenv.env).not.toBeEmptyObject();
3233

33-
const output = runCli(config);
34+
const output = runCli(config) as DotenvConfigOutput;
3435
expect(output).toHaveProperty("parsed");
3536
expect(output.parsed).not.toBeEmptyObject();
3637
});
3738

3839
it("should return the expected output using environmental options", () => {
3940
process.env.DOTENV_CONFIG_DEBUG = "true";
40-
const dotenv = runCli(load);
41+
const dotenv = runCli(load) as Dotenv;
4142
expect(dotenv instanceof Dotenv).toBeTruthy();
4243
expect(dotenv.env).not.toBeEmptyObject();
4344
});
4445

4546
it("should return the expected output using argv options", () => {
4647
process.argv = ["dotenv_config_debug=true"];
47-
const dotenv = runCli(load);
48+
const dotenv = runCli(load) as Dotenv;
4849
expect(dotenv instanceof Dotenv).toBeTruthy();
4950
expect(dotenv.env).not.toBeEmptyObject();
5051
});

0 commit comments

Comments
 (0)