Skip to content

Commit 52d712a

Browse files
authored
fix: cosmiconfig returns null if no config found (#285)
1 parent d8bf426 commit 52d712a

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@1stg/tslint-config": "^1.2.0",
2929
"@types/eslint": "^7.2.7",
3030
"@types/jest": "^26.0.20",
31-
"@types/node": "^14.14.34",
31+
"@types/node": "^14.14.35",
3232
"@types/react": "^17.0.3",
3333
"@types/rebass": "^4.0.8",
3434
"@types/unist": "^2.0.3",
@@ -40,7 +40,7 @@
4040
"ts-jest": "^26.5.3",
4141
"ts-node": "^9.1.1",
4242
"tslint": "^6.1.3",
43-
"type-coverage": "^2.16.3",
43+
"type-coverage": "^2.17.0",
4444
"typescript": "^4.2.3",
4545
"yarn-deduplicate": "^3.1.0"
4646
},

packages/eslint-plugin-mdx/src/rules/helpers.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ export const getRemarkProcessor = (searchFrom: string, isMdx: boolean) => {
4949
}).search
5050
}
5151

52-
/* istanbul ignore next */
53-
let result: Partial<CosmiconfigResult> = {}
52+
let result: Partial<CosmiconfigResult>
5453

5554
try {
5655
result = searchSync(searchFrom)
@@ -72,7 +71,7 @@ export const getRemarkProcessor = (searchFrom: string, isMdx: boolean) => {
7271
}
7372

7473
/* istanbul ignore next */
75-
const { plugins = [], settings } = (result.config ||
74+
const { plugins = [], settings } = (result?.config ||
7675
{}) as Partial<RemarkConfig>
7776

7877
try {

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,10 +3029,10 @@
30293029
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256"
30303030
integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==
30313031

3032-
"@types/node@*", "@types/node@^14.14.34":
3033-
version "14.14.34"
3034-
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.34.tgz#07935194fc049069a1c56c0c274265abeddf88da"
3035-
integrity sha512-dBPaxocOK6UVyvhbnpFIj2W+S+1cBTkHQbFQfeeJhoKFbzYcVUGHvddeWPSucKATb3F0+pgDq0i6ghEaZjsugA==
3032+
"@types/node@*", "@types/node@^14.14.35":
3033+
version "14.14.35"
3034+
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.35.tgz#42c953a4e2b18ab931f72477e7012172f4ffa313"
3035+
integrity sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==
30363036

30373037
"@types/normalize-package-data@^2.4.0":
30383038
version "2.4.0"
@@ -12004,10 +12004,10 @@ type-coverage-core@^2.16.3:
1200412004
tslib "1 || 2"
1200512005
tsutils "3"
1200612006

12007-
type-coverage@^2.16.3:
12008-
version "2.16.3"
12009-
resolved "https://registry.yarnpkg.com/type-coverage/-/type-coverage-2.16.3.tgz#410ea60ad6982dc4078a36e7373456f0935ecca6"
12010-
integrity sha512-sRT+bWDWqh4FD0tQBvGAedNIteRYC+qLL51nfCEcyAwfIrTR0hm50YoP48Ri2zVFyJwmAQF92Smu4ody2k36sw==
12007+
type-coverage@^2.17.0:
12008+
version "2.17.0"
12009+
resolved "https://registry.yarnpkg.com/type-coverage/-/type-coverage-2.17.0.tgz#233fc75578c9b670e64de1ae26c8b9a14e14b760"
12010+
integrity sha512-MlM2gmsQZClsNZhZ+blOflCDhVBoyXSYnQptF4Lr8QZxLCqImCNCAi2oofK8pQDmB6rALokokqyzg69PNY7axA==
1201112011
dependencies:
1201212012
minimist "1"
1201312013
type-coverage-core "^2.16.3"

0 commit comments

Comments
 (0)