mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
Make any typing linting opt-out instead of opt-in (#6542)
# Description of Changes Reconfigure linting of `any` type to an opt-out instead of an opt-in strategy now that we're close enough to everything supporting it. Also slightly expands the scope of things included in the linting.
This commit is contained in:
+14
-3
@@ -187,12 +187,23 @@ tasks:
|
||||
lint:
|
||||
desc: "Run linting"
|
||||
deps: [install]
|
||||
cmds:
|
||||
- task: lint:eslint
|
||||
- task: lint:dpdm
|
||||
|
||||
lint:eslint:
|
||||
desc: "Run ESLint linting"
|
||||
deps: [install]
|
||||
cmds:
|
||||
- npx eslint --max-warnings=0
|
||||
# Globs (not a bare dir) so dpdm walks the whole tree — `editor/src`
|
||||
# alone matched only 2 files. dpdm expands the braces itself, so this is
|
||||
|
||||
lint:dpdm:
|
||||
desc: "Run circular import linting"
|
||||
deps: [install]
|
||||
cmds:
|
||||
# Globs so dpdm walks the whole tree. dpdm expands the braces itself, so this is
|
||||
# shell-agnostic. Covers editor, portal, and the shared design system.
|
||||
- 'npx dpdm "editor/src/**/*.{ts,tsx}" "portal/src/**/*.{ts,tsx}" "shared/**/*.{ts,tsx}" --circular --no-warning --no-tree --exit-code circular:1'
|
||||
- npx dpdm "editor/src/**/*.{ts,tsx}" "portal/src/**/*.{ts,tsx}" "shared/**/*.{ts,tsx}" --circular --no-warning --no-tree --exit-code circular:1
|
||||
|
||||
lint:fix:
|
||||
desc: "Auto-fix lint issues"
|
||||
|
||||
@@ -225,7 +225,7 @@ export type MaterialSymbolIcon = ${usedIcons.map((icon) => `'${icon}'`).join(" |
|
||||
|
||||
export interface IconSet {
|
||||
prefix: string;
|
||||
icons: Record<string, any>;
|
||||
icons: Record<string, unknown>;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import "@testing-library/jest-dom";
|
||||
@@ -99,12 +99,12 @@ Object.defineProperty(globalThis, "crypto", {
|
||||
subtle: {
|
||||
digest: vi
|
||||
.fn()
|
||||
.mockImplementation(async (_algorithm: string, _data: any) => {
|
||||
.mockImplementation(async (_algorithm: string, _data: BufferSource) => {
|
||||
// Always return the mock hash buffer regardless of input
|
||||
return mockHashBuffer.slice();
|
||||
}),
|
||||
},
|
||||
getRandomValues: vi.fn().mockImplementation((array: any) => {
|
||||
getRandomValues: vi.fn().mockImplementation((array: Uint8Array) => {
|
||||
// Mock getRandomValues if needed
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
array[i] = Math.floor(Math.random() * 256);
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { createTheme, MantineColorsTuple } from "@mantine/core";
|
||||
import {
|
||||
createTheme,
|
||||
MantineColorsTuple,
|
||||
MantineTheme,
|
||||
MantineThemeComponent,
|
||||
} from "@mantine/core";
|
||||
|
||||
// Define color tuples using CSS variables
|
||||
const primary: MantineColorsTuple = [
|
||||
@@ -113,7 +118,7 @@ export const mantineTheme = createTheme({
|
||||
},
|
||||
variants: {
|
||||
// Custom button variant for PDF tools
|
||||
pdfTool: (_theme: any) => ({
|
||||
pdfTool: (_theme: MantineTheme) => ({
|
||||
root: {
|
||||
backgroundColor: "var(--bg-surface)",
|
||||
border: "1px solid var(--border-default)",
|
||||
@@ -125,7 +130,7 @@ export const mantineTheme = createTheme({
|
||||
},
|
||||
}),
|
||||
},
|
||||
} as any,
|
||||
} as MantineThemeComponent,
|
||||
|
||||
Paper: {
|
||||
styles: {
|
||||
@@ -146,7 +151,7 @@ export const mantineTheme = createTheme({
|
||||
},
|
||||
},
|
||||
Textarea: {
|
||||
styles: (_theme: any) => ({
|
||||
styles: (_theme: MantineTheme) => ({
|
||||
input: {
|
||||
backgroundColor: "var(--bg-surface)",
|
||||
borderColor: "var(--border-default)",
|
||||
@@ -164,7 +169,7 @@ export const mantineTheme = createTheme({
|
||||
},
|
||||
|
||||
TextInput: {
|
||||
styles: (_theme: any) => ({
|
||||
styles: (_theme: MantineTheme) => ({
|
||||
input: {
|
||||
backgroundColor: "var(--bg-surface)",
|
||||
borderColor: "var(--border-default)",
|
||||
@@ -182,7 +187,7 @@ export const mantineTheme = createTheme({
|
||||
},
|
||||
|
||||
PasswordInput: {
|
||||
styles: (_theme: any) => ({
|
||||
styles: (_theme: MantineTheme) => ({
|
||||
input: {
|
||||
backgroundColor: "var(--bg-surface)",
|
||||
borderColor: "var(--border-default)",
|
||||
@@ -223,7 +228,7 @@ export const mantineTheme = createTheme({
|
||||
color: "var(--text-primary)",
|
||||
"--combobox-option-hover": "var(--hover-bg)",
|
||||
"--combobox-option-selected": "var(--color-primary-100)",
|
||||
} as any,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -251,7 +256,7 @@ export const mantineTheme = createTheme({
|
||||
color: "var(--text-primary)",
|
||||
"--combobox-option-hover": "var(--hover-bg)",
|
||||
"--combobox-option-selected": "var(--color-primary-100)",
|
||||
} as any,
|
||||
},
|
||||
},
|
||||
},
|
||||
Tooltip: {
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ declare module "*.module.css";
|
||||
declare module "assets/material-symbols-icons.json" {
|
||||
const value: {
|
||||
prefix: string;
|
||||
icons: Record<string, any>;
|
||||
icons: Record<string, unknown>;
|
||||
width?: number;
|
||||
height?: number;
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
||||
function updatePosthogConsent() {
|
||||
if (!posthog.__loaded) return;
|
||||
const optIn =
|
||||
(window.CookieConsent as any)?.acceptedService?.("posthog", "analytics") ||
|
||||
false;
|
||||
window.CookieConsent?.acceptedService?.("posthog", "analytics") || false;
|
||||
if (optIn) {
|
||||
posthog.set_config({ persistence: "localStorage+cookie" });
|
||||
posthog.opt_in_capturing();
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
const reportWebVitals = (onPerfEntry) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
@@ -143,15 +143,20 @@ export default defineConfig(
|
||||
],
|
||||
},
|
||||
},
|
||||
// Folders that have been cleaned up and are now conformant - stricter rules enforced here
|
||||
// Stricter rules that not all sub-folders are conformant to yet
|
||||
{
|
||||
files: [
|
||||
"editor/src/desktop/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/proprietary/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/saas/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/prototypes/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"portal/src/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"shared/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
files: srcGlobs,
|
||||
ignores: [
|
||||
"editor/src/core/components/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/contexts/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/data/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/hooks/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/pages/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/services/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/tests/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/tools/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/types/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
"editor/src/core/utils/**/*.{js,mjs,jsx,ts,tsx}",
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
|
||||
Reference in New Issue
Block a user