mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2026-01-15 12:15:02 +00:00
Stricter compiling
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { sanitize } from "dompurify";
|
import DOMPurify from "dompurify";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import {
|
import {
|
||||||
convertImageLinksToHtml,
|
convertImageLinksToHtml,
|
||||||
@@ -21,7 +21,7 @@ const SanitizedContent: FC<{ content: string; decrypted: boolean }> = ({
|
|||||||
<div
|
<div
|
||||||
// eslint-disable-next-line react/no-danger
|
// eslint-disable-next-line react/no-danger
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: sanitize(decryptedContent || content, {
|
__html: DOMPurify.sanitize(decryptedContent || content, {
|
||||||
ALLOWED_ATTR: ["src"],
|
ALLOWED_ATTR: ["src"],
|
||||||
ALLOWED_TAGS: ["br", "img"],
|
ALLOWED_TAGS: ["br", "img"],
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class ErrorBoundary extends Component<
|
|||||||
this.state = { hasError: false };
|
this.state = { hasError: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
public shouldComponentUpdate(): boolean {
|
public override shouldComponentUpdate(): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export class ErrorBoundary extends Component<
|
|||||||
return { hasError: true };
|
return { hasError: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public override render(): React.ReactNode {
|
||||||
const {
|
const {
|
||||||
props: { children, FallbackRender },
|
props: { children, FallbackRender },
|
||||||
state: { hasError },
|
state: { hasError },
|
||||||
|
|||||||
@@ -33,13 +33,13 @@ const withStyledComponents = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Document extends NextDocument {
|
class Document extends NextDocument {
|
||||||
public static async getInitialProps(
|
public static override async getInitialProps(
|
||||||
ctx: DocumentContext
|
ctx: DocumentContext
|
||||||
): Promise<DocumentInitialProps> {
|
): Promise<DocumentInitialProps> {
|
||||||
return withStyledComponents(ctx);
|
return withStyledComponents(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): React.JSX.Element {
|
public override render(): React.JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Html lang={DEFAULT_LOCALE}>
|
<Html lang={DEFAULT_LOCALE}>
|
||||||
<Head />
|
<Head />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
"allowUnreachableCode": false,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
@@ -11,6 +12,7 @@
|
|||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"plugins": [{ "name": "next" }],
|
"plugins": [{ "name": "next" }],
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user