Skip to content

Commit

Permalink
test: fix unit test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Dec 1, 2023
1 parent 80846ee commit be9830f
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 2,648 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@types/mdast": "^4.0.3",
"acorn": "^8.11.2",
"cliui": "npm:@isaacs/cliui@^8.0.2",
"mdast-util-frontmatter": "^2.0.1",
"mdast-util-gfm": "^3.0.0",
"prettier": "^2.8.8",
"unified": "^11.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-mdx/src/rules/remark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const remark: Rule.RuleModule = {
// related to https://github.com/eslint/eslint/issues/14198
message: JSON.stringify(message),
loc:
'start' in place
/* istanbul ignore next */ 'start' in place
? {
...point,
start: { ...place.start, column: place.start.column - 1 },
Expand Down
13 changes: 13 additions & 0 deletions patches/eslint+8.54.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/eslint/lib/cli-engine/formatters/stylish.js b/node_modules/eslint/lib/cli-engine/formatters/stylish.js
index a808448..1d4b79e 100644
--- a/node_modules/eslint/lib/cli-engine/formatters/stylish.js
+++ b/node_modules/eslint/lib/cli-engine/formatters/stylish.js
@@ -5,7 +5,7 @@
"use strict";

const chalk = require("chalk"),
- stripAnsi = require("strip-ansi"),
+ stripAnsi = require("strip-ansi-cjs"),
table = require("text-table");

//------------------------------------------------------------------------------
11 changes: 11 additions & 0 deletions patches/string-length+4.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/node_modules/string-length/index.js b/node_modules/string-length/index.js
index c2589a2..3040f0a 100644
--- a/node_modules/string-length/index.js
+++ b/node_modules/string-length/index.js
@@ -1,5 +1,5 @@
'use strict';
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const charRegex = require('char-regex');

const stringLength = string => {
112 changes: 0 additions & 112 deletions test/__snapshots__/fixtures.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,6 @@ exports[`fixtures lint code blocks should work as expected: code-blocks.md 1`] =
"column": 1,
"endColumn": 6,
"endLine": 3,
"fix": {
"range": [
0,
511,
],
"text": "# abc
# abc
<div>Hello World!</div>
<!-- eslint-disable unicorn/prefer-spread -->
\`\`\`JavaScript
export var a = 1 == 2
export const b = [].concat(a)
\`\`\`
export var a = 1 == 2
\`\`\`log
This is not parsable as JavaScript!
\`\`\`
<!-- eslint-mdx -->
\`\`\`jsx
export const App = () => <div>2 > 1</div>
\`\`\`
<!-- eslint-skip -->
\`\`\`TypeScript
export type Value = 1 | 2 | 3 | 4 | 5
\`\`\`
\`\`\`MarkDown
# abc
# abc
\`\`\`
<!-- mdx -->
\`\`\`mdx
import React from 'react'
<header>Header</header>
# abc
# abc
\`\`\`
",
},
"line": 3,
"message": "Don’t use multiple top level headings (1:1)",
"nodeType": "Program",
Expand Down Expand Up @@ -1051,62 +995,6 @@ exports[`fixtures should match all snapshots: code-blocks.md 1`] = `
"column": 1,
"endColumn": 6,
"endLine": 3,
"fix": {
"range": [
0,
511,
],
"text": "# abc
# abc
<div>Hello World!</div>
<!-- eslint-disable unicorn/prefer-spread -->
\`\`\`JavaScript
export var a = 1 == 2
export const b = [].concat(a)
\`\`\`
export var a = 1 == 2
\`\`\`log
This is not parsable as JavaScript!
\`\`\`
<!-- eslint-mdx -->
\`\`\`jsx
export const App = () => <div>2 > 1</div>
\`\`\`
<!-- eslint-skip -->
\`\`\`TypeScript
export type Value = 1 | 2 | 3 | 4 | 5
\`\`\`
\`\`\`MarkDown
# abc
# abc
\`\`\`
<!-- mdx -->
\`\`\`mdx
import React from 'react'
<header>Header</header>
# abc
# abc
\`\`\`
",
},
"line": 3,
"message": "Don’t use multiple top level headings (1:1)",
"nodeType": "Program",
Expand Down
Loading

0 comments on commit be9830f

Please sign in to comment.