mdx-js / eslint-mdx

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

feat: support new flat config #468

Closed JounQin closed 11 months ago

JounQin commented 11 months ago

close #455

changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: 42d2e68b2d075dd6f5be0c689b3c9bbb28d36225

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ----------------- | ----- | | eslint-mdx | Minor | | eslint-plugin-mdx | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codesandbox-ci[bot] commented 11 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

github-actions[bot] commented 11 months ago

📊 Package size report   No changes

File Before After
Total (Includes all files) 1.3 MB 1.3 MB
Tarball size 130.0 kB 130.0 kB
Unchanged files | File | Size | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------: | | [`.babelrc`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.babelrc) | `35 B` | | [`.changeset/config.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.changeset/config.json) | `372 B` | | [`.changeset/README.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.changeset/README.md) | `510 B` | | [`.codesandbox/ci.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.codesandbox/ci.json) | `76 B` | | [`.editorconfig`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.editorconfig) | `161 B` | | [`.eslintrc.js`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.eslintrc.js) | `591 B` | | [`.gitattributes`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.gitattributes) | `35 B` | | [`.github/FUNDING.yml`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.github/FUNDING.yml) | `204 B` | | [`.github/workflows/ci.yml`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.github/workflows/ci.yml) | `941 B` | | [`.github/workflows/codeql.yml`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.github/workflows/codeql.yml) | `836 B` | | [`.github/workflows/pkg-size.yml`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.github/workflows/pkg-size.yml) | `496 B` | | [`.github/workflows/release.yml`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.github/workflows/release.yml) | `914 B` | | [`.lintstagedrc.js`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.lintstagedrc.js) | `50 B` | | [`.simple-git-hooks.js`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/.simple-git-hooks.js) | `51 B` | | [`CHANGELOG.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/CHANGELOG.md) | `283 B` | | [`CONTRIBUTING.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/CONTRIBUTING.md) | `931 B` | | [`LICENSE`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/LICENSE) | `1.1 kB` | | [`package.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/package.json) | `2.5 kB` | | [`packages/eslint-mdx/CHANGELOG.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/CHANGELOG.md) | `22.6 kB` | | [`packages/eslint-mdx/package.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/package.json) | `1.2 kB` | | [`packages/eslint-mdx/README.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/README.md) | `9.8 kB` | | [`packages/eslint-mdx/shim.d.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/shim.d.ts) | `1.4 kB` | | [`packages/eslint-mdx/src/helpers.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/helpers.ts) | `4.3 kB` | | [`packages/eslint-mdx/src/index.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/index.ts) | `98 B` | | [`packages/eslint-mdx/src/parser.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/parser.ts) | `2.3 kB` | | [`packages/eslint-mdx/src/sync.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/sync.ts) | `384 B` | | [`packages/eslint-mdx/src/tokens.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/tokens.ts) | `6.7 kB` | | [`packages/eslint-mdx/src/types.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/types.ts) | `1.0 kB` | | [`packages/eslint-mdx/src/worker.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/src/worker.ts) | `21.0 kB` | | [`packages/eslint-mdx/tsconfig.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-mdx/tsconfig.json) | `131 B` | | [`packages/eslint-plugin-mdx/CHANGELOG.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/CHANGELOG.md) | `23.7 kB` | | [`packages/eslint-plugin-mdx/package.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/package.json) | `1.0 kB` | | [`packages/eslint-plugin-mdx/README.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/README.md) | `9.8 kB` | | [`packages/eslint-plugin-mdx/src/configs/base.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/configs/base.ts) | `305 B` | | [`packages/eslint-plugin-mdx/src/configs/code-blocks.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/configs/code-blocks.ts) | `1.0 kB` | | [`packages/eslint-plugin-mdx/src/configs/index.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/configs/index.ts) | `345 B` | | [`packages/eslint-plugin-mdx/src/configs/overrides.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/configs/overrides.ts) | `725 B` | | [`packages/eslint-plugin-mdx/src/configs/recommended.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/configs/recommended.ts) | `806 B` | | [`packages/eslint-plugin-mdx/src/helpers.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/helpers.ts) | `620 B` | | [`packages/eslint-plugin-mdx/src/index.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/index.ts) | `105 B` | | [`packages/eslint-plugin-mdx/src/processors/helpers.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/processors/helpers.ts) | `633 B` | | [`packages/eslint-plugin-mdx/src/processors/index.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/processors/index.ts) | `244 B` | | [`packages/eslint-plugin-mdx/src/processors/options.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/processors/options.ts) | `1.8 kB` | | [`packages/eslint-plugin-mdx/src/processors/remark.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/processors/remark.ts) | `1.5 kB` | | [`packages/eslint-plugin-mdx/src/processors/types.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/processors/types.ts) | `241 B` | | [`packages/eslint-plugin-mdx/src/rules/.eslintrc`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/rules/.eslintrc) | `124 B` | | [`packages/eslint-plugin-mdx/src/rules/index.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/rules/index.ts) | `138 B` | | [`packages/eslint-plugin-mdx/src/rules/remark.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/rules/remark.ts) | `3.5 kB` | | [`packages/eslint-plugin-mdx/src/rules/types.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/src/rules/types.ts) | `415 B` | | [`packages/eslint-plugin-mdx/tsconfig.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/packages/eslint-plugin-mdx/tsconfig.json) | `131 B` | | [`README.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/README.md) | `9.8 kB` | | [`test/__snapshots__/fixtures.test.ts.snap`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/__snapshots__/fixtures.test.ts.snap) | `31.1 kB` | | [`test/__snapshots__/parser.test.ts.snap`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/__snapshots__/parser.test.ts.snap) | `1.1 MB` | | [`test/fixtures.test.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures.test.ts) | `1.6 kB` | | [`test/fixtures/287.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/287.mdx) | `204 B` | | [`test/fixtures/292.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/292.mdx) | `191 B` | | [`test/fixtures/334.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/334.mdx) | `70 B` | | [`test/fixtures/336.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/336.mdx) | `178 B` | | [`test/fixtures/367.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/367.mdx) | `87 B` | | [`test/fixtures/371.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/371.mdx) | `75 B` | | [`test/fixtures/380.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/380.mdx) | `11.0 kB` | | [`test/fixtures/391.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/391.mdx) | `62 B` | | [`test/fixtures/429.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/429.mdx) | `52 B` | | [`test/fixtures/435.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/435.mdx) | `134 B` | | [`test/fixtures/445.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/445.mdx) | `188 B` | | [`test/fixtures/450.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/450.mdx) | `418 B` | | [`test/fixtures/acorn.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/acorn.mdx) | `860 B` | | [`test/fixtures/adjacent.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/adjacent.mdx) | `50 B` | | [`test/fixtures/async/.remarkrc`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/async/.remarkrc) | `67 B` | | [`test/fixtures/async/test.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/async/test.md) | `15 B` | | [`test/fixtures/basic.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/basic.mdx) | `405 B` | | [`test/fixtures/basic.tsx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/basic.tsx) | `77 B` | | [`test/fixtures/blank-lines.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/blank-lines.mdx) | `768 B` | | [`test/fixtures/code-blocks.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/code-blocks.md) | `511 B` | | [`test/fixtures/comments.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/comments.mdx) | `162 B` | | [`test/fixtures/details.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/details.mdx) | `881 B` | | [`test/fixtures/dir.mdx/.gitkeep`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/dir.mdx/.gitkeep) | `0 B` | | [`test/fixtures/esm/.remarkrc.mjs`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/esm/.remarkrc.mjs) | `103 B` | | [`test/fixtures/esm/test.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/esm/test.md) | `15 B` | | [`test/fixtures/jsx-in-list.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/jsx-in-list.mdx) | `810 B` | | [`test/fixtures/leading-spaces.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/leading-spaces.mdx) | `42 B` | | [`test/fixtures/markdown.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/markdown.md) | `5 B` | | [`test/fixtures/no-unescaped-entities.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/no-unescaped-entities.mdx) | `99 B` | | [`test/fixtures/no-unused-expressions.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/no-unused-expressions.mdx) | `90 B` | | [`test/fixtures/processor.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/processor.mdx) | `13 B` | | [`test/fixtures/remark.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/remark.md) | `171 B` | | [`test/fixtures/remark.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/remark.mdx) | `169 B` | | [`test/fixtures/style/.remarkrc`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/style/.remarkrc) | `228 B` | | [`test/fixtures/style/nested.md`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/style/nested.md) | `10 B` | | [`test/fixtures/style/plugin1.cjs`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/style/plugin1.cjs) | `26 B` | | [`test/fixtures/style/plugin2.mjs`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/style/plugin2.mjs) | `24 B` | | [`test/fixtures/unicorn.jsx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/unicorn.jsx) | `119 B` | | [`test/fixtures/unicorn.mdx`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/fixtures/unicorn.mdx) | `118 B` | | [`test/helpers.test.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/helpers.test.ts) | `874 B` | | [`test/helpers.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/helpers.ts) | `548 B` | | [`test/parser.test.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/parser.test.ts) | `4.0 kB` | | [`test/remark.test.ts`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/test/remark.test.ts) | `2.8 kB` | | [`tsconfig.base.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/tsconfig.base.json) | `235 B` | | [`tsconfig.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/tsconfig.json) | `309 B` | | [`tsconfig.lib.json`](https://github.com/mdx-js/eslint-mdx/blob/feat/flat-config/tsconfig.lib.json) | `180 B` |

🤖 This report was automatically generated by pkg-size-action

codecov-commenter commented 11 months ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (223ed69) 100.00% compared to head (42d2e68) 100.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #468 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 16 19 +3 Lines 171 188 +17 Branches 31 32 +1 ========================================= + Hits 171 188 +17 ``` | [Files Changed](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [packages/eslint-mdx/src/index.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LW1keC9zcmMvaW5kZXgudHM=) | `100.00% <100.00%> (ø)` | | | [packages/eslint-mdx/src/meta.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LW1keC9zcmMvbWV0YS50cw==) | `100.00% <100.00%> (ø)` | | | [...kages/eslint-plugin-mdx/src/configs/code-blocks.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi1tZHgvc3JjL2NvbmZpZ3MvY29kZS1ibG9ja3MudHM=) | `100.00% <100.00%> (ø)` | | | [packages/eslint-plugin-mdx/src/configs/flat.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi1tZHgvc3JjL2NvbmZpZ3MvZmxhdC50cw==) | `100.00% <100.00%> (ø)` | | | [packages/eslint-plugin-mdx/src/index.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi1tZHgvc3JjL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | | | [packages/eslint-plugin-mdx/src/meta.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi1tZHgvc3JjL21ldGEudHM=) | `100.00% <100.00%> (ø)` | | | [packages/eslint-plugin-mdx/src/processors/index.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi1tZHgvc3JjL3Byb2Nlc3NvcnMvaW5kZXgudHM=) | `100.00% <100.00%> (ø)` | | | [...ackages/eslint-plugin-mdx/src/processors/remark.ts](https://app.codecov.io/gh/mdx-js/eslint-mdx/pull/468?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi1tZHgvc3JjL3Byb2Nlc3NvcnMvcmVtYXJrLnRz) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JounQin commented 11 months ago

a) looks like many changes in one PR! Can you make things smaller in the future so I can review better? A bunch of these changes seem unrelated to flat configs! b) I don’t know what flat configs are, but if you think this is a good addition, 👍

@wooorm They're all for flat config support. Nothing more.