Skip to content

Commit ceb41bb

Browse files
authored
Clean up dev console warnings (#11916)
* use esm on tailwind config to fix cjs warnings * use next/link instead of <a> * ignore punnycode deprecation warning
1 parent 911ccde commit ceb41bb

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

next.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,11 @@ module.exports = withSentryConfig(nextConfig, {
8888
applicationKey: 'sentry-docs',
8989
},
9090
});
91+
92+
process.on('warning', warning => {
93+
if (warning.code === 'DEP0040') {
94+
// Ignore punnycode deprecation warning, we don't control its usage
95+
return;
96+
}
97+
console.warn(warning); // Log other warnings
98+
});

src/components/header.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import {Fragment} from 'react';
44
import {HamburgerMenuIcon} from '@radix-ui/react-icons';
55
import Image from 'next/image';
6+
import Link from 'next/link';
67

78
import SentryLogoSVG from 'sentry-docs/logos/sentry-logo-dark.svg';
89

@@ -44,7 +45,7 @@ export function Header({pathname, searchPlatforms, noSearch}: Props) {
4445
</label>
4546
</button>
4647
)}
47-
<a
48+
<Link
4849
href="/"
4950
title="Sentry error monitoring"
5051
className="flex flex-shrink-0 items-center lg:w-[calc(var(--sidebar-width,300px)-2rem)] text-2xl font-medium text-[var(--foreground)]"
@@ -58,7 +59,7 @@ export function Header({pathname, searchPlatforms, noSearch}: Props) {
5859
/>
5960
</div>
6061
Docs
61-
</a>
62+
</Link>
6263
{!noSearch && (
6364
<div className="hidden md:flex justify-center lg:justify-start w-full px-6">
6465
<Search path={pathname} searchPlatforms={searchPlatforms} showChatBot />

tailwind.config.js tailwind.config.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
const defaultTheme = require('tailwindcss/defaultTheme');
1+
import defaultTheme from 'tailwindcss/defaultTheme';
22

3+
import Typography from '@tailwindcss/typography';
4+
import Forms from '@tailwindcss/forms';
35
import {
46
isolateInsideOfContainer,
57
scopedPreflightStyles,
68
} from 'tailwindcss-scoped-preflight';
79

810
/** @type {import('tailwindcss').Config} */
9-
module.exports = {
11+
export default {
1012
darkMode: ['selector', '.dark'],
1113
content: ['./app/**/*.{js,ts,jsx,tsx}', './src/components/**/*.{js,ts,jsx,tsx,mdx}'],
1214
theme: {
@@ -60,10 +62,8 @@ module.exports = {
6062
},
6163
},
6264
plugins: [
63-
require('@tailwindcss/typography'),
64-
require('@tailwindcss/forms')({
65-
strategy: 'class',
66-
}),
65+
Typography,
66+
Forms({strategy: 'class'}),
6767
scopedPreflightStyles({
6868
// pretty minimalistic example. Same options as in the previous example are available
6969
isolationStrategy: isolateInsideOfContainer('.tw-app'),

0 commit comments

Comments
 (0)