Skip to content

Commit 712c872

Browse files
committed
fix(dpes): bump cosmiconfig to v6.0.0
1 parent 0933b89 commit 712c872

File tree

8 files changed

+1020
-1013
lines changed

8 files changed

+1020
-1013
lines changed

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,30 @@
2424
"type-coverage": "type-coverage --cache --detail --ignore-catch --ignore-files *.d.ts --strict"
2525
},
2626
"devDependencies": {
27-
"@1stg/lib-config": "^0.1.6",
28-
"@1stg/tslint-config": "^0.5.5",
29-
"@types/cosmiconfig": "^5.0.3",
27+
"@1stg/lib-config": "^0.1.13",
28+
"@1stg/tslint-config": "^0.5.6",
3029
"@types/eslint": "^6.1.3",
31-
"@types/jest": "^24.0.21",
32-
"@types/node": "^12.12.5",
30+
"@types/jest": "^24.0.22",
31+
"@types/node": "^12.12.7",
3332
"@types/react": "^16.9.11",
3433
"@types/rebass": "^4.0.3",
3534
"@types/unist": "^2.0.3",
35+
"cosmiconfig": "^6.0.0",
3636
"eslint-mdx": "link:packages/eslint-mdx/src",
3737
"eslint-plugin-mdx": "link:packages/eslint-plugin-mdx/src",
38-
"lerna": "^3.18.3",
38+
"lerna": "^3.18.4",
3939
"npm-run-all": "^4.1.5",
4040
"react": "^16.11.0",
4141
"ts-jest": "^24.1.0",
42-
"ts-node": "^8.4.1",
43-
"tslint": "^5.20.0",
44-
"type-coverage": "^2.3.0",
45-
"typescript": "^3.6.4"
42+
"ts-node": "^8.5.0",
43+
"tslint": "^5.20.1",
44+
"type-coverage": "^2.3.0"
4645
},
4746
"resolutions": {
48-
"@babel/core": "^7.6.4",
49-
"typescript": "^3.6.4"
47+
"@babel/core": "^7.7.2",
48+
"babel-eslint": "^10.0.3",
49+
"eslint-plugin-prettier": "^3.1.1",
50+
"typescript": "^3.7.2"
5051
},
5152
"commitlint": {
5253
"extends": [

packages/eslint-mdx/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"dependencies": {
3232
"espree": "^6.1.2",
3333
"remark-mdx": "^1.5.1",
34-
"remark-parse": "^7.0.1",
34+
"remark-parse": "^7.0.2",
3535
"tslib": "^1.10.0",
36-
"unified": "^8.4.1"
36+
"unified": "^8.4.2"
3737
}
3838
}

packages/eslint-mdx/src/parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,12 @@ export class Parser {
284284
const {
285285
start: nodeStart,
286286
end: nodeEnd,
287+
/* istanbul ignore next */
287288
loc: { start, end } = {
288289
start: { column: nodeStart, line: 1 },
289290
end: { column: nodeEnd, line: 1 },
290291
},
292+
/* istanbul ignore next */
291293
range = [nodeStart, nodeEnd],
292294
} = jsNode
293295
const startLine = line + start.line - 1

packages/eslint-plugin-mdx/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
"eslint": ">=5.0.0"
3030
},
3131
"dependencies": {
32-
"cosmiconfig": "^5.2.1",
32+
"cosmiconfig": "^6.0.0",
3333
"eslint-mdx": "^1.6.2",
3434
"eslint-plugin-react": ">=7.0.0",
3535
"remark-mdx": "^1.5.1",
36-
"remark-parse": "^7.0.1",
37-
"remark-stringify": "^7.0.3",
36+
"remark-parse": "^7.0.2",
37+
"remark-stringify": "^7.0.4",
3838
"tslib": "^1.10.0",
39-
"unified": "^8.4.1",
40-
"vfile": "^4.0.1"
39+
"unified": "^8.4.2",
40+
"vfile": "^4.0.2"
4141
},
4242
"optionalDependencies": {
4343
"rebass": "^4.0.7"

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'path'
22

3-
import cosmiconfig, { CosmiconfigResult, Explorer } from 'cosmiconfig'
3+
import { cosmiconfigSync } from 'cosmiconfig'
4+
import { CosmiconfigResult } from 'cosmiconfig/dist/types'
45
import remarkMdx from 'remark-mdx'
56
import remarkParse from 'remark-parse'
67
import remarkStringify from 'remark-stringify'
@@ -37,14 +38,14 @@ export const requirePkg = (
3738
throw error
3839
}
3940

40-
let remarkConfig: Explorer
41+
let searchSync: (searchFrom?: string) => CosmiconfigResult
4142
let remarkProcessor: Processor
4243

4344
export const getRemarkProcessor = (searchFrom: string) => {
44-
if (!remarkConfig) {
45-
remarkConfig = cosmiconfig('remark', {
45+
if (!searchSync) {
46+
searchSync = cosmiconfigSync('remark', {
4647
packageProp: 'remarkConfig',
47-
})
48+
}).search
4849
}
4950

5051
if (!remarkProcessor) {
@@ -55,7 +56,7 @@ export const getRemarkProcessor = (searchFrom: string) => {
5556

5657
/* istanbul ignore next */
5758
const { config, filepath }: Partial<CosmiconfigResult> =
58-
remarkConfig.searchSync(searchFrom) || {}
59+
searchSync(searchFrom) || {}
5960
/* istanbul ignore next */
6061
const { plugins = [], settings }: Partial<RemarkConfig> = config || {}
6162

test/__snapshots__/fixtures.test.ts.snap

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Lorem ipsum dolor sit _amet_, consectetur adipiscing elit. Ut ac lobortis velit.
2828
`;
2929

3030
exports[`fixtures should match all snapshots: blank-lines.mdx 1`] = `
31-
"import { Box } from '@rebass/emotion'
31+
"import {Box} from '@rebass/emotion'
3232
3333
# Getting Started
3434
@@ -79,10 +79,11 @@ exports[`fixtures should match all snapshots: no-jsx-html-comments.mdx 1`] = `
7979
8080
<header>Header{/** JSX HTML comment */}</header>
8181
<main>Main Content</main>
82-
83-
<header>Header
84-
{/** JSX
85-
HTML comment */}</header>
82+
<header>
83+
Header
84+
{/** JSX
85+
HTML comment */}
86+
</header>
8687
<main>Main Content</main>
8788
8889
Inline <header>Header<!-- JSX HTML comment --></header>

test/parser.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,17 @@ describe('parser', () => {
157157
'Expected corresponding JSX closing tag for <h1>',
158158
)
159159
expect(() => parser.parse('Header\n<>', parserOptions)).toThrow(
160-
'Unexpected token (1:2)',
160+
'Line 1: Unexpected token',
161161
)
162162
expect(() => parser.parse('<main><</main>', parserOptions)).toThrow(
163-
'Unexpected token (1:7)',
163+
'Line 1: Unexpected token',
164164
)
165165
expect(() => parser.parse('<main>{<}</main>', parserOptions)).toThrow(
166-
'Unexpected token (1:8)',
166+
'Line 1: Unexpected token',
167167
)
168168
expect(() =>
169169
parser.parse('<main>\n<section><</section></main>', parserOptions),
170-
).toThrow('Unexpected token (2:10)')
170+
).toThrow('Line 2: Unexpected token')
171171
})
172172

173173
it('should not throw on adjacent JSX nodes', () =>

0 commit comments

Comments
 (0)