Skip to content

Commit

Permalink
✨ feat(package.json): add lint:md script
Browse files Browse the repository at this point in the history
This commit adds a new script to the `package.json` file that uses the `remark` tool to perform markdown linting. The script is designed to check all markdown files in the repository and fix any issues found.

The changes include adding a new property to the package.json file and modifying the `lint-staged` property to use the new script for markdown files instead of using `remark-gfm`.
  • Loading branch information
canisminor1990 committed May 30, 2023
1 parent 75e05c0 commit baab529
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const config = {
plugins: [
'remark-preset-lint-recommended',
['remark-lint-list-item-indent', 'space'],
['remark-lint-no-literal-urls', false],
],
};

module.exports = config;
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ This project is [MIT](./LICENSE) licensed.
<!-- LINK GROUP -->

[profile-url]: https://github.com/lobehub
[issues-url]: https://github.com/lobehub/lobe-ui/issues/new/choose
[gitpod-url]: https://gitpod.io/#https://github.com/lobehub/lobe-ui

<!-- SHIELD LINK GROUP -->
Expand Down Expand Up @@ -160,4 +159,4 @@ This project is [MIT](./LICENSE) licensed.
<!-- issues -->

[issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-ui.svg?style=flat
[issues-url]: https://img.shields.io/github/issues/lobehub/lobe-ui.svg?style=flat
[issues-url]: https://github.com/lobehub/lobe-ui/issues/new/choose
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"docs:build": "npm run build:theme && dumi build",
"doctor": "father doctor",
"lint": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
"lint:md": "remark . -f -q",
"prepare": "husky install && npm run setup",
"prepublishOnly": "father doctor && npm run build",
"prettier": "prettier -c --write \"**/**\"",
Expand All @@ -51,7 +52,11 @@
"type-check": "tsc -p tsconfig-check.json"
},
"lint-staged": {
"*.{md,json}": [
"*.md": [
"remark -f -q",
"prettier --write --no-error-on-unmatched-pattern"
],
"*.json": [
"prettier --write --no-error-on-unmatched-pattern"
],
"*.{js,jsx}": [
Expand Down Expand Up @@ -88,7 +93,6 @@
"react-layout-kit": "^1",
"react-markdown": "^8",
"react-rnd": "^10",
"remark-gfm": "^3",
"shiki-es": "^0",
"styled-components": "beta",
"ts-md5": "^1",
Expand Down Expand Up @@ -131,6 +135,12 @@
"prettier-plugin-packagejson": "^2",
"react": "^18",
"react-dom": "^18",
"remark": "^14",
"remark-cli": "^11",
"remark-gfm": "^3",
"remark-lint": "^9",
"remark-lint-list-item-indent": "^3",
"remark-preset-lint-recommended": "^6",
"semantic-release": "^21",
"semantic-release-config-gitmoji": "^1",
"stylelint": "^15",
Expand Down
9 changes: 2 additions & 7 deletions src/ContextMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const MenuComponent = forwardRef<
const parentId = useFloatingParentNodeId();
const isNested = parentId !== null;

const { refs, floatingStyles, context } = useFloating<HTMLButtonElement>({
const { refs, context } = useFloating<HTMLButtonElement>({
nodeId,
open: isOpen,
onOpenChange: setIsOpen,
Expand Down Expand Up @@ -278,12 +278,7 @@ const MenuComponent = forwardRef<
modal={false}
returnFocus={!isNested}
>
<div
className={styles.container}
ref={refs.setFloating}
style={floatingStyles}
{...getFloatingProps()}
>
<div className={styles.container} ref={refs.setFloating} {...getFloatingProps()}>
{items?.map(renderMenuItem)}
</div>
</FloatingFocusManager>
Expand Down

0 comments on commit baab529

Please sign in to comment.