-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add ESLint support for MDX files (#1307)
# Overview <!-- A clear and concise description of what this pr is about. --> related to #1295 I have implemented ESLint linting for MDX files in this project. ### Changes - Integrate `eslint-plugin-mdx` to enable linting for MDX files - Apply Prettier rules and JavaScript rules to code blocks within MDX files - Update existing MDX files to comply with the new linting rules This enhancement will improve code consistency and readability across our MDX documentation. ### Additional Notes - While [mdx/remark rules](https://github.com/mdx-js/eslint-mdx?tab=readme-ov-file#rules) offer potential for more diverse rule sets, they are not implemented in this PR. This could be explored in future iterations. - `@eslint/markdown` is designed for `md` files. Since the majority of Suspensive's documentation uses `MDX`, linting for md files was not considered in this implementation. ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests. --------- Co-authored-by: Jonghyeon Ko <[email protected]> Co-authored-by: 김석진(poki) <[email protected]> Co-authored-by: Gwansik Kim <[email protected]>
- Loading branch information
1 parent
b642880
commit e7dd6ba
Showing
74 changed files
with
1,685 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "antfu.pnpm-catalog-lens"] | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"antfu.pnpm-catalog-lens", | ||
"unifiedjs.vscode-mdx" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import { Callout as NextraCallout } from 'nextra/components' | ||
import type { ComponentProps } from 'react' | ||
|
||
interface CalloutProps extends Omit<ComponentProps<typeof NextraCallout>, 'type'> { | ||
type: 'deprecated' | 'experimental' | ComponentProps<typeof NextraCallout>['type'] | ||
interface CalloutProps | ||
extends Omit<ComponentProps<typeof NextraCallout>, 'type'> { | ||
type: | ||
| 'deprecated' | ||
| 'experimental' | ||
| ComponentProps<typeof NextraCallout>['type'] | ||
} | ||
|
||
export const Callout = ({ type, ...props }: CalloutProps) => { | ||
const definedType = type === 'deprecated' ? 'error' : type === 'experimental' ? 'warning' : type | ||
const definedType = | ||
type === 'deprecated' ? 'error' : type === 'experimental' ? 'warning' : type | ||
|
||
return <NextraCallout {...props} type={definedType} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.