Skip to content

Commit

Permalink
chore: bump all deps, add test case for #435 (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Aug 3, 2023
1 parent 8397553 commit 223ed69
Show file tree
Hide file tree
Showing 9 changed files with 10,819 additions and 9,597 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"typecov": "type-coverage"
},
"devDependencies": {
"@1stg/lib-config": "^11.1.0",
"@1stg/lib-config": "^12.0.0",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@types/eslint": "^8.37.0",
"@changesets/cli": "^2.26.2",
"@types/eslint": "^8.44.1",
"@types/eslint-plugin-markdown": "^2.0.0",
"@types/jest": "^29.5.1",
"@types/node": "^18.16.3",
"@types/react": "^18.2.0",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.6",
"@types/react": "^18.2.18",
"@types/unist": "^2.0.6",
"jest": "^29.5.0",
"patch-package": "^7.0.0",
"jest": "^29.6.2",
"patch-package": "^8.0.0",
"react": "^18.2.0",
"ts-jest": "^29.1.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"type-coverage": "^2.25.0",
"typescript": "^5.0.4",
"yarn-deduplicate": "^6.0.1"
"type-coverage": "^2.26.0",
"typescript": "^5.1.6",
"yarn-deduplicate": "^6.0.2"
},
"resolutions": {
"prettier": "^2.8.8"
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"eslint": ">=8.0.0"
},
"dependencies": {
"acorn": "^8.8.2",
"acorn": "^8.10.0",
"acorn-jsx": "^5.3.2",
"espree": "^9.5.1",
"espree": "^9.6.1",
"estree-util-visit": "^1.2.1",
"remark-mdx": "^2.3.0",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
"remark-parse": "^10.0.2",
"remark-stringify": "^10.0.3",
"synckit": "^0.8.5",
"tslib": "^2.5.0",
"tslib": "^2.6.1",
"unified": "^10.1.2",
"unified-engine": "^10.1.0",
"unist-util-visit": "^4.1.2",
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-mdx/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { Point } from 'unist'
import type { NormalPosition } from './types'

export const last = <T>(items: T[] | readonly T[]) =>
// eslint-disable-next-line unicorn/prefer-at -- FIXME: Node 16.6+ required
items && items[items.length - 1]

export const arrayify = <T, R = T extends Array<infer S> ? S : T>(
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
},
"dependencies": {
"eslint-mdx": "^2.1.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-markdown": "^3.0.1",
"remark-mdx": "^2.3.0",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
"tslib": "^2.5.0",
"remark-parse": "^10.0.2",
"remark-stringify": "^10.0.3",
"tslib": "^2.6.1",
"unified": "^10.1.2",
"vfile": "^5.3.7"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin-mdx/src/rules/remark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export const remark: Rule.RuleModule = {
fixable: 'code',
},
create(context) {
// eslint-disable-next-line sonar/deprecation -- FIXME: ESLint 8.40+ required
const filename = context.getFilename()
const extname = path.extname(filename)
// eslint-disable-next-line sonar/deprecation -- FIXME: ESLint 8.40+ required
const sourceCode = context.getSourceCode()
const options = context.parserOptions as ParserOptions
const isMdx = [
Expand Down Expand Up @@ -52,6 +54,7 @@ export const remark: Rule.RuleModule = {
fileOptions: {
path: physicalFilename,
value: sourceText,
// eslint-disable-next-line sonar/deprecation -- FIXME: ESLint 8.40+ required
cwd: context.getCwd(),
},
physicalFilename,
Expand Down
187 changes: 185 additions & 2 deletions test/__snapshots__/fixtures.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,24 @@ exports[`fixtures should match all snapshots: 380.mdx 1`] = `
"ruleId": "unicorn/prevent-abbreviations",
"severity": 2,
},
{
"column": 40,
"endColumn": 60,
"endLine": 204,
"fix": {
"range": [
4593,
4615,
],
"text": ".at(-1)",
},
"line": 204,
"message": "Prefer \`.at(…)\` over \`[….length - index]\`.",
"messageId": "negative-index",
"nodeType": "BinaryExpression",
"ruleId": "unicorn/prefer-at",
"severity": 2,
},
{
"column": 28,
"endColumn": 26,
Expand Down Expand Up @@ -430,6 +448,168 @@ exports[`fixtures should match all snapshots: 429.mdx 1`] = `
]
`;
exports[`fixtures should match all snapshots: 435.mdx 1`] = `
[
{
"column": 1,
"endColumn": 2,
"endLine": 2,
"fix": {
"range": [
8,
9,
],
"text": " ",
},
"line": 2,
"message": "Replace \`\` with \`··\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 1,
"endColumn": 3,
"endLine": 3,
"fix": {
"range": [
18,
20,
],
"text": " ",
},
"line": 3,
"message": "Replace \`↹↹\` with \`····\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 1,
"endColumn": 3,
"endLine": 4,
"fix": {
"range": [
39,
41,
],
"text": " ",
},
"line": 4,
"message": "Replace \`↹↹\` with \`····\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 1,
"endColumn": 2,
"endLine": 5,
"fix": {
"range": [
66,
67,
],
"text": " ",
},
"line": 5,
"message": "Replace \`\` with \`··\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 1,
"endColumn": 2,
"endLine": 7,
"fix": {
"range": [
72,
73,
],
"text": " ",
},
"line": 7,
"message": "Replace \`\` with \`··\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 2,
"endColumn": 4,
"endLine": 10,
"fix": {
"range": [
91,
93,
],
"text": "",
},
"line": 10,
"message": "Delete \`··\`",
"messageId": "delete",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 3,
"endColumn": 16,
"endLine": 12,
"fix": {
"range": [
102,
115,
],
"text": "<Components
",
},
"line": 12,
"message": "Replace \`··<Components\` with \`<Components⏎···\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
{
"column": 6,
"endColumn": 16,
"endLine": 12,
"line": 12,
"message": "'Components' is not defined.",
"messageId": "undefined",
"nodeType": "JSXIdentifier",
"ruleId": "react/jsx-no-undef",
"severity": 2,
},
{
"column": 1,
"endColumn": 7,
"endLine": 13,
"fix": {
"range": [
124,
130,
],
"text": "\`}
",
},
"line": 13,
"message": "Replace \`····\`}\` with \`\`}⏎·\`",
"messageId": "replace",
"nodeType": null,
"ruleId": "prettier/prettier",
"severity": 2,
},
]
`;
exports[`fixtures should match all snapshots: 445.mdx 1`] = `
[
{
Expand Down Expand Up @@ -620,6 +800,7 @@ exports[`fixtures should match all snapshots: acorn.mdx 1`] = `
"fatal": true,
"line": 9,
"message": "Parsing error: Unexpected character \`\\\` (U+005C) in name, expected a name character such as letters, digits, \`$\`, or \`_\`; whitespace before attributes; or the end of the tag",
"nodeType": null,
"ruleId": null,
"severity": 2,
},
Expand Down Expand Up @@ -714,8 +895,8 @@ the installation guides.
p={3}
bg="lightgray"
style={{
textAlign: 'center',
fontWeight: 'bold',
textAlign: 'center',
fontWeight: 'bold',
}}
>
[Next.js](/getting-started/next) |
Expand Down Expand Up @@ -892,6 +1073,7 @@ exports[`fixtures should match all snapshots: comments.mdx 1`] = `
"fatal": true,
"line": 2,
"message": "Parsing error: Unexpected character \`!\` (U+0021) before name, expected a character that can start a name, such as a letter, \`$\`, or \`_\` (note: to create a comment in MDX, use \`{/* text */}\`)",
"nodeType": null,
"ruleId": null,
"severity": 2,
},
Expand All @@ -905,6 +1087,7 @@ exports[`fixtures should match all snapshots: details.mdx 1`] = `
"fatal": true,
"line": 1,
"message": "Parsing error: Expected a closing tag for \`</summary>\` (1:1-1:10) before the end of \`paragraph\`",
"nodeType": null,
"ruleId": null,
"severity": 2,
},
Expand Down
Loading

0 comments on commit 223ed69

Please sign in to comment.