From f7e7efe2a331a4e297a0e75203bae1f95912f61b Mon Sep 17 00:00:00 2001 From: JounQin Date: Tue, 30 Jul 2019 23:52:23 +0800 Subject: [PATCH] fix: .* could not match multi lines, use [\s\S]* instead, close #4 --- package.json | 2 +- src/tsconfig.json | 1 - src/utils.ts | 2 +- test/fixture4.mdx | 65 +++++++++++++++++++++++++++++++++++++++++++++++ tsconfig.json | 2 +- 5 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 test/fixture4.mdx diff --git a/package.json b/package.json index 5afd6fae..3eca5fb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rxts/eslint-plugin-mdx", - "version": "0.3.0", + "version": "0.3.1", "description": "ESLint Parser/Plugin for MDX", "repository": "git@github.com:rx-ts/eslint-plugin-mdx.git", "author": "JounQin ", diff --git a/src/tsconfig.json b/src/tsconfig.json index 05560803..47326780 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../tsconfig.json", "compilerOptions": { "declaration": true, - "module": "commonjs", "outDir": "../dist" } } diff --git a/src/utils.ts b/src/utils.ts index f8b91f71..baac2dba 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -26,7 +26,7 @@ const comment = '|' export const OPEN_TAG_REGEX = new RegExp(`^(?:${openTag})$`) export const CLOSE_TAG_REGEX = new RegExp(`^(?:${closeTag})$`) export const OPEN_CLOSE_TAG_REGEX = new RegExp( - `^(?:${openTag + '.*' + closeTag})$`, + `^(?:${openTag + '[\\s\\S]*' + closeTag})$`, ) export const VOID_TAG_REGEX = new RegExp(`^(?:${voidTag})$`) export const COMMENT_REGEX = new RegExp(`^(?:${comment})$`) diff --git a/test/fixture4.mdx b/test/fixture4.mdx new file mode 100644 index 00000000..76fc7f35 --- /dev/null +++ b/test/fixture4.mdx @@ -0,0 +1,65 @@ +--- +name: FollowReveal +route: /follow-reveal +--- + +# FollowReveal + +A `` is a like a `` that follows the mouse's movements in and out of the component. +Just like the ``, place it in an element that has `position: relative` and make sure it is a direct child of the element on which you define the `perspective` property. + +import { Props, Playground } from 'docz' +import FollowReveal from './FollowReveal' +import { Front, PlaceHolderImage, Grid } from 'docs/PlayGroundUtils' + + + +## Basic Usage + + + {() => { + const perspective = 400 + return ( +
+ + More info + + +
+ ) + }} +
+ +## Masonry Layout + +Looks even cooler in a grid layout. + + + {() => { + const perspective = 400 + return ( + + {Array.from(Array(4 * 4).keys()).map(id => ( +
+ + More info + +
+
+ ))} + + ) + }} + diff --git a/tsconfig.json b/tsconfig.json index 9945dca0..d4c58fb7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "esModuleInterop": true, "jsx": "preserve", "lib": ["esnext", "dom"], - "module": "esnext", + "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "strict": true,