Skip to content

Commit b038db9

Browse files
committed
chore: bump deps, fix typing issues
1 parent 8de1c46 commit b038db9

File tree

9 files changed

+3836
-3960
lines changed

9 files changed

+3836
-3960
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
- ubuntu-latest
1515
- windows-latest
1616
node:
17-
- 14
1817
- 16
1918
- 18
19+
- 20
2020
runs-on: ${{ matrix.os }}
2121
steps:
2222
- name: Checkout Repo

.github/workflows/codeql.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'CodeQL'
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
branches: ['master']
8+
schedule:
9+
- cron: '41 19 * * 6'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [javascript]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
queries: +security-and-quality
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2
40+
with:
41+
category: '/language:${{ matrix.language }}'

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@
2626
"typecov": "type-coverage"
2727
},
2828
"devDependencies": {
29-
"@1stg/lib-config": "^10.2.1",
30-
"@changesets/changelog-github": "^0.4.6",
31-
"@changesets/cli": "^2.24.4",
32-
"@types/eslint": "^8.4.6",
29+
"@1stg/lib-config": "^11.1.0",
30+
"@changesets/changelog-github": "^0.4.8",
31+
"@changesets/cli": "^2.26.1",
32+
"@types/eslint": "^8.37.0",
3333
"@types/eslint-plugin-markdown": "^2.0.0",
34-
"@types/jest": "^29.0.0",
35-
"@types/node": "^18.7.14",
36-
"@types/react": "^18.0.18",
34+
"@types/jest": "^29.5.1",
35+
"@types/node": "^18.16.3",
36+
"@types/react": "^18.2.0",
3737
"@types/unist": "^2.0.6",
38-
"jest": "^29.0.1",
39-
"patch-package": "^6.4.7",
38+
"jest": "^29.5.0",
39+
"patch-package": "^7.0.0",
4040
"react": "^18.2.0",
41-
"ts-jest": "^28.0.8",
41+
"ts-jest": "^29.1.0",
4242
"ts-node": "^10.9.1",
43-
"type-coverage": "^2.22.0",
44-
"typescript": "^4.8.2",
45-
"yarn-deduplicate": "^6.0.0"
43+
"type-coverage": "^2.25.0",
44+
"typescript": "^5.0.4",
45+
"yarn-deduplicate": "^6.0.1"
4646
},
4747
"resolutions": {
48-
"prettier": "^2.7.1"
48+
"prettier": "^2.8.8"
4949
},
5050
"commitlint": {
5151
"extends": [

packages/eslint-mdx/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030
"eslint": ">=8.0.0"
3131
},
3232
"dependencies": {
33-
"acorn": "^8.8.0",
33+
"acorn": "^8.8.2",
3434
"acorn-jsx": "^5.3.2",
35-
"cosmiconfig": "^7.0.1",
36-
"espree": "^9.4.0",
37-
"estree-util-visit": "^1.2.0",
38-
"remark-mdx": "^2.1.3",
35+
"cosmiconfig": "^8.1.3",
36+
"espree": "^9.5.1",
37+
"estree-util-visit": "^1.2.1",
38+
"remark-mdx": "^2.3.0",
3939
"remark-parse": "^10.0.1",
4040
"remark-stringify": "^10.0.2",
41-
"synckit": "^0.8.4",
42-
"tslib": "^2.4.0",
41+
"synckit": "^0.8.5",
42+
"tslib": "^2.5.0",
4343
"unified": "^10.1.2",
44-
"unist-util-visit": "^4.1.1",
44+
"unist-util-visit": "^4.1.2",
4545
"uvu": "^0.5.6",
46-
"vfile": "^5.3.4"
46+
"vfile": "^5.3.7"
4747
}
4848
}

packages/eslint-mdx/src/worker.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ import type {
1616
ObjectExpression,
1717
Program,
1818
SpreadElement,
19-
TemplateElement,
2019
} from 'estree'
2120
import type { JSXClosingElement, JSXElement, JSXFragment } from 'estree-jsx'
22-
import type { BlockContent, PhrasingContent } from 'mdast'
21+
import type {
22+
BlockContent,
23+
PhrasingContent,
24+
Literal as MdastLiteral,
25+
} from 'mdast'
2326
import type { Options } from 'micromark-extension-mdx-expression'
2427
import type { Root } from 'remark-mdx'
2528
import { extractProperties, runAsWorker } from 'synckit'
@@ -301,7 +304,9 @@ runAsWorker(
301304

302305
processed.add(node)
303306

304-
function handleChildren(node: BlockContent | PhrasingContent) {
307+
function handleChildren(
308+
node: BlockContent | MdastLiteral | PhrasingContent,
309+
) {
305310
return 'children' in node
306311
? (node.children as Array<BlockContent | PhrasingContent>).reduce<
307312
JSXElement['children']
@@ -336,7 +341,9 @@ runAsWorker(
336341
: []
337342
}
338343

339-
function handleNode(node: BlockContent | PhrasingContent) {
344+
function handleNode(
345+
node: BlockContent | MdastLiteral | PhrasingContent,
346+
) {
340347
if (
341348
node.type !== 'mdxJsxTextElement' &&
342349
node.type !== 'mdxJsxFlowElement'
@@ -355,7 +362,7 @@ runAsWorker(
355362

356363
let expression: BaseExpression
357364

358-
if (node.name) {
365+
if ('name' in node && node.name) {
359366
const nodeNameLength = node.name.length
360367
const nodeNameStart = nextCharOffset(nodeStart + 1)
361368

@@ -612,7 +619,7 @@ runAsWorker(
612619
/**
613620
* Copied from @see https://github.com/eslint/espree/blob/main/lib/espree.js#L206-L220
614621
*/
615-
const templateElement = node as TemplateElement
622+
const templateElement = node
616623

617624
const startOffset = -1
618625
const endOffset = templateElement.tail ? 1 : 2

packages/eslint-plugin-mdx/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
"dependencies": {
3434
"eslint-mdx": "^2.0.5",
3535
"eslint-plugin-markdown": "^3.0.0",
36-
"remark-mdx": "^2.1.3",
36+
"remark-mdx": "^2.3.0",
3737
"remark-parse": "^10.0.1",
3838
"remark-stringify": "^10.0.2",
39-
"tslib": "^2.4.0",
39+
"tslib": "^2.5.0",
4040
"unified": "^10.1.2",
41-
"vfile": "^5.3.4"
41+
"vfile": "^5.3.7"
4242
}
4343
}

packages/eslint-plugin-mdx/src/processors/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ESLinter.prototype.verify = function (
3939
(typeof config.extractConfig === 'function'
4040
? config.extractConfig(
4141
/* istanbul ignore next */
42+
// eslint-disable-next-line unicorn/no-typeof-undefined
4243
typeof options === 'undefined' || typeof options === 'string'
4344
? options
4445
: options.filename,

test/__snapshots__/fixtures.test.ts.snap

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ exports[`fixtures should match all snapshots: 292.mdx 1`] = `
174174
"ruleId": "prettier/prettier",
175175
"severity": 2,
176176
},
177+
{
178+
"column": 46,
179+
"endColumn": 51,
180+
"endLine": 5,
181+
"line": 5,
182+
"message": "Unknown property 'story' found",
183+
"messageId": "unknownProp",
184+
"nodeType": "JSXAttribute",
185+
"ruleId": "react/no-unknown-property",
186+
"severity": 2,
187+
},
177188
]
178189
`;
179190
@@ -277,6 +288,7 @@ exports[`fixtures should match all snapshots: 380.mdx 1`] = `
277288
"severity": 2,
278289
"suggestions": [
279290
{
291+
"data": {},
280292
"desc": "First argument is an \`array\`.",
281293
"fix": {
282294
"range": [
@@ -290,6 +302,7 @@ exports[`fixtures should match all snapshots: 380.mdx 1`] = `
290302
"messageId": "argument-is-spreadable",
291303
},
292304
{
305+
"data": {},
293306
"desc": "First argument is not an \`array\`.",
294307
"fix": {
295308
"range": [
@@ -738,6 +751,17 @@ exports[`fixtures should match all snapshots: jsx-in-list.mdx 1`] = `
738751
"ruleId": "prettier/prettier",
739752
"severity": 2,
740753
},
754+
{
755+
"column": 46,
756+
"endColumn": 51,
757+
"endLine": 1,
758+
"line": 1,
759+
"message": "Unknown property 'story' found",
760+
"messageId": "unknownProp",
761+
"nodeType": "JSXAttribute",
762+
"ruleId": "react/no-unknown-property",
763+
"severity": 2,
764+
},
741765
{
742766
"column": 9,
743767
"endColumn": 58,
@@ -759,6 +783,17 @@ exports[`fixtures should match all snapshots: jsx-in-list.mdx 1`] = `
759783
"ruleId": "prettier/prettier",
760784
"severity": 2,
761785
},
786+
{
787+
"column": 46,
788+
"endColumn": 51,
789+
"endLine": 5,
790+
"line": 5,
791+
"message": "Unknown property 'story' found",
792+
"messageId": "unknownProp",
793+
"nodeType": "JSXAttribute",
794+
"ruleId": "react/no-unknown-property",
795+
"severity": 2,
796+
},
762797
{
763798
"column": 9,
764799
"endColumn": 58,
@@ -780,6 +815,17 @@ exports[`fixtures should match all snapshots: jsx-in-list.mdx 1`] = `
780815
"ruleId": "prettier/prettier",
781816
"severity": 2,
782817
},
818+
{
819+
"column": 46,
820+
"endColumn": 51,
821+
"endLine": 9,
822+
"line": 9,
823+
"message": "Unknown property 'story' found",
824+
"messageId": "unknownProp",
825+
"nodeType": "JSXAttribute",
826+
"ruleId": "react/no-unknown-property",
827+
"severity": 2,
828+
},
783829
{
784830
"column": 9,
785831
"endColumn": 58,
@@ -801,6 +847,17 @@ exports[`fixtures should match all snapshots: jsx-in-list.mdx 1`] = `
801847
"ruleId": "prettier/prettier",
802848
"severity": 2,
803849
},
850+
{
851+
"column": 46,
852+
"endColumn": 51,
853+
"endLine": 13,
854+
"line": 13,
855+
"message": "Unknown property 'story' found",
856+
"messageId": "unknownProp",
857+
"nodeType": "JSXAttribute",
858+
"ruleId": "react/no-unknown-property",
859+
"severity": 2,
860+
},
804861
{
805862
"column": 9,
806863
"endColumn": 58,
@@ -822,6 +879,17 @@ exports[`fixtures should match all snapshots: jsx-in-list.mdx 1`] = `
822879
"ruleId": "prettier/prettier",
823880
"severity": 2,
824881
},
882+
{
883+
"column": 46,
884+
"endColumn": 51,
885+
"endLine": 17,
886+
"line": 17,
887+
"message": "Unknown property 'story' found",
888+
"messageId": "unknownProp",
889+
"nodeType": "JSXAttribute",
890+
"ruleId": "react/no-unknown-property",
891+
"severity": 2,
892+
},
825893
{
826894
"column": 9,
827895
"endColumn": 58,
@@ -843,6 +911,17 @@ exports[`fixtures should match all snapshots: jsx-in-list.mdx 1`] = `
843911
"ruleId": "prettier/prettier",
844912
"severity": 2,
845913
},
914+
{
915+
"column": 46,
916+
"endColumn": 51,
917+
"endLine": 21,
918+
"line": 21,
919+
"message": "Unknown property 'story' found",
920+
"messageId": "unknownProp",
921+
"nodeType": "JSXAttribute",
922+
"ruleId": "react/no-unknown-property",
923+
"severity": 2,
924+
},
846925
]
847926
`;
848927

0 commit comments

Comments
 (0)