mdx-js / eslint-mdx

ESLint Parser/Plugin for MDX
https://npmjs.org/eslint-plugin-mdx
MIT License
264 stars 32 forks source link

[v2] acorn thrown content in table even with `remark-gfm` #381

Closed JounQin closed 2 years ago

JounQin commented 2 years ago

Initial checklist

Affected packages and versions

2.0.0.next.1

Link to runnable example

No response

Steps to reproduce

Notice the disabledDate and disabledTime

| 名称           | 类型                                                                                                                                   | 默认值               | 描述                                 |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------ |
| clearable      | boolean                                                                                                                                | true                 | 是否显示清除按钮                     |
| clearText      | string                                                                                                                                 | 'clear'              | 清除按钮文案                         |
| format         | string                                                                                                                                 | 'YYYY-MM-DD'         | 日期显示格式                         |
| showTime       | boolean                                                                                                                                | false                | 是否显示选择时间                     |
| type           | DatePickerType                                                                                                                         | DatePickerType.Day   | 指定日期组件类型,为选择日,月,或年 |
| size           | ComponentSize                                                                                                                          | ComponentSize.Medium | 触发器大小                           |
| weekStartDay   | number                                                                                                                                 | 0                    | 面板的第一个日期为周几               |
| disabledDate   | (date: Dayjs, type: DateNavRange) => boolean                                                                                         | () => false          | 禁用某些日期                         |
| disabledTime   | (date: Dayjs) => {hours: () => number[];minutes: (hour?: number) => number[];seconds: (hour?: number, minute?: number) => number[];} | () => null           | 禁用某些时间                         |
| extraFooter    | TemplateRef                                                                                                                            | null                 | 额外的 footer                        |
| footerTemplate | TemplateRef                                                                                                                            | null                 | 自定义 footer 内容区                 |
| minDate        | Dayjs                                                                                                                                  | null                 | 最小日期                             |
| maxDate        | Dayjs                                                                                                                                  | null                 | 最大日期                             |

Expected behavior

No error

Actual behavior

[207:43: Could not parse expression with acorn: Unexpected content after expression] {
  reason: 'Could not parse expression with acorn: Unexpected content after expression',
  line: 207,
  column: 43,
  source: 'micromark-extension-mdx-expression',
  ruleId: 'acorn',
  position: {
    start: { line: 207, column: 43, offset: 6492 },
    end: { line: null, column: null }
  }
}

Runtime

Node v16

Package manager

yarn v1

OS

macOS

Build and bundle tools

No response

JounQin commented 2 years ago

cc @wooorm

Workaround, wrap the content with ``

JounQin commented 2 years ago

If it is intended in mdx, feel free to close it. @wooorm

wooorm commented 2 years ago

This is (likely) intended, yes! See: https://mdxjs.com/docs/troubleshooting-mdx/#could-not-parse-expression-with-acorn-error. You can escape the {, so like this: \{