docs: added no console eslint rule (#4170)

This commit is contained in:
Shahed Nasser
2023-05-24 19:57:37 +03:00
committed by GitHub
parent e281469eb8
commit 345beb7010
6 changed files with 15 additions and 10 deletions
+9
View File
@@ -81,6 +81,15 @@ module.exports = {
], ],
"space-infix-ops": "error", "space-infix-ops": "error",
"eol-last": ["error", "always"], "eol-last": ["error", "always"],
"no-console": [
"error",
{
allow: [
"error",
"warn"
]
}
]
}, },
env: { env: {
es6: true, es6: true,
-1
View File
@@ -6,7 +6,6 @@ import React, {
useState, useState,
} from "react" } from "react"
import { prefersReducedMotion } from "@docusaurus/theme-common" import { prefersReducedMotion } from "@docusaurus/theme-common"
import useIsBrowser from "@docusaurus/useIsBrowser"
type SidebarContextType = { type SidebarContextType = {
hasSidebar: boolean hasSidebar: boolean
@@ -63,7 +63,6 @@ export default function DocPageLayoutSidebar({
}} }}
onMouseUp={(e) => { onMouseUp={(e) => {
const target = e.target as Element const target = e.target as Element
console.log("here", target.classList)
if ( if (
target.classList.contains("menu__list-item") || target.classList.contains("menu__list-item") ||
target.parentElement.classList.contains("menu__list-item") target.parentElement.classList.contains("menu__list-item")
+1 -3
View File
@@ -1,10 +1,9 @@
import React, { useCallback, useEffect, useState } from "react" import React from "react"
import clsx from "clsx" import clsx from "clsx"
import { import {
HtmlClassNameProvider, HtmlClassNameProvider,
ThemeClassNames, ThemeClassNames,
PageMetadata, PageMetadata,
prefersReducedMotion,
} from "@docusaurus/theme-common" } from "@docusaurus/theme-common"
import { import {
docVersionSearchTag, docVersionSearchTag,
@@ -16,7 +15,6 @@ import DocPageLayout from "@theme/DocPage/Layout"
import NotFound from "@theme/NotFound" import NotFound from "@theme/NotFound"
import SearchMetadata from "@theme/SearchMetadata" import SearchMetadata from "@theme/SearchMetadata"
import type { Props } from "@theme/DocPage" import type { Props } from "@theme/DocPage"
import { SidebarContext } from "@site/src/context/sidebar"
import SidebarProvider from "@site/src/providers/Sidebar" import SidebarProvider from "@site/src/providers/Sidebar"
function DocPageMetadata(props: Props): JSX.Element { function DocPageMetadata(props: Props): JSX.Element {
@@ -7,7 +7,7 @@ import useIsBrowser from "@docusaurus/useIsBrowser"
import { useLocation } from "@docusaurus/router" import { useLocation } from "@docusaurus/router"
import AnnouncementBar from "../../AnnouncementBar/index" import AnnouncementBar from "../../AnnouncementBar/index"
function DocSidebarDesktop({ path, sidebar, isHidden }: Props) { function DocSidebarDesktop({ path, sidebar }: Props) {
const { const {
navbar: { hideOnScroll }, navbar: { hideOnScroll },
} = useThemeConfig() } = useThemeConfig()
+4 -4
View File
@@ -119,10 +119,10 @@ declare module "@medusajs/docs" {
export declare type NavbarActionButton = NavbarActionBase & { export declare type NavbarActionButton = NavbarActionBase & {
type: "button" type: "button"
events?: { events?: {
onClick?: (e: any) => any onClick?: (e: MouseEvent) => void
onMouseEnter?: (e: any) => any onMouseEnter?: (e: MouseEvent) => void
onMouseLeave?: (e: any) => any onMouseLeave?: (e: MouseEvent) => void
onMouseOver?: (e: any) => any onMouseOver?: (e: MouseEvent) => void
} }
} }