prototypey.org - atproto lexicon typescript toolkit - mirror https://github.com/tylersayshi/prototypey
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lint rules back on

Tyler fe0a9bdd 5494cf73

+40 -39
+17 -31
packages/site/eslint.config.js
··· 2 2 import reactCompiler from "eslint-plugin-react-compiler"; 3 3 import tseslint from "typescript-eslint"; 4 4 5 - export default tseslint.config( 6 - ...baseConfig, 7 - { 8 - files: ["**/*.{jsx,tsx}"], 9 - extends: [ 10 - tseslint.configs.strictTypeChecked, 11 - tseslint.configs.stylisticTypeChecked, 12 - ], 13 - languageOptions: { 14 - parserOptions: { 15 - projectService: { allowDefaultProject: ["*.config.*s"] }, 16 - }, 17 - }, 18 - plugins: { 19 - "react-compiler": reactCompiler, 20 - }, 21 - rules: { 22 - "@typescript-eslint/consistent-type-definitions": "off", 23 - "@typescript-eslint/no-unsafe-assignment": "off", 24 - "@typescript-eslint/no-unsafe-argument": "off", 25 - "@typescript-eslint/no-unsafe-member-access": "off", 26 - "@typescript-eslint/no-unsafe-call": "off", 27 - "@typescript-eslint/restrict-plus-operands": "off", 28 - "@typescript-eslint/no-confusing-void-expression": "off", 29 - "@typescript-eslint/prefer-nullish-coalescing": "off", 30 - "@typescript-eslint/prefer-regexp-exec": "off", 31 - "@typescript-eslint/no-implied-eval": "off", 32 - "@typescript-eslint/no-non-null-assertion": "off", 33 - "@typescript-eslint/no-floating-promises": "off", 34 - "react-compiler/react-compiler": "error", 5 + export default tseslint.config(...baseConfig, { 6 + files: ["**/*.{jsx,tsx}"], 7 + extends: [ 8 + tseslint.configs.strictTypeChecked, 9 + tseslint.configs.stylisticTypeChecked, 10 + ], 11 + languageOptions: { 12 + parserOptions: { 13 + projectService: { allowDefaultProject: ["*.config.*s"] }, 35 14 }, 36 15 }, 37 - ); 16 + plugins: { 17 + "react-compiler": reactCompiler, 18 + }, 19 + rules: { 20 + "@typescript-eslint/consistent-type-definitions": "off", 21 + "react-compiler/react-compiler": "error", 22 + }, 23 + });
+6 -2
packages/site/src/components/Editor.tsx
··· 22 22 setTheme(e.matches ? "vs-dark" : "vs-light"); 23 23 }; 24 24 mediaQuery.addEventListener("change", handleChange); 25 - return () => mediaQuery.removeEventListener("change", handleChange); 25 + return () => { 26 + mediaQuery.removeEventListener("change", handleChange); 27 + }; 26 28 }, []); 27 29 28 30 useEffect(() => { ··· 128 130 defaultLanguage="typescript" 129 131 path="file:///main.ts" 130 132 value={value} 131 - onChange={(value) => onChange(value || "")} 133 + onChange={(value) => { 134 + onChange(value ?? ""); 135 + }} 132 136 theme={theme} 133 137 options={{ 134 138 minimap: { enabled: false },
+1 -1
packages/site/src/components/OutputPanel.tsx
··· 22 22 setTheme(e.matches ? "vs-dark" : "vs-light"); 23 23 }; 24 24 mediaQuery.addEventListener("change", handleChange); 25 - return () => mediaQuery.removeEventListener("change", handleChange); 25 + return () => { mediaQuery.removeEventListener("change", handleChange); }; 26 26 }, []); 27 27 28 28 return (
+15 -5
packages/site/src/components/Playground.tsx
··· 1 + /* eslint-disable @typescript-eslint/no-unsafe-argument */ 2 + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 + /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 + /* eslint-disable @typescript-eslint/no-unsafe-call */ 1 5 import { useState, useEffect, useRef } from "react"; 2 6 import { Editor } from "./Editor"; 3 7 import { OutputPanel } from "./OutputPanel"; ··· 28 32 useRef<Monaco.languages.typescript.TypeScriptWorker | null>(null); 29 33 30 34 const handleCodeChange = (newCode: string) => { 31 - setCode(newCode); 35 + void setCode(newCode); 32 36 }; 33 37 34 38 const handleEditorReady = () => { ··· 41 45 setTheme(e.matches ? "vs-dark" : "vs-light"); 42 46 }; 43 47 mediaQuery.addEventListener("change", handleChange); 44 - return () => mediaQuery.removeEventListener("change", handleChange); 48 + return () => { 49 + mediaQuery.removeEventListener("change", handleChange); 50 + }; 45 51 }, []); 46 52 47 53 useEffect(() => { ··· 66 72 useEffect(() => { 67 73 const timeoutId = setTimeout(async () => { 68 74 try { 69 - const nsMatch = code.match( 70 - /const\s+lex\s*=\s*lx\.lexicon\([^]*?\}\s*\);/, 75 + const nsMatch = /const\s+lex\s*=\s*lx\.lexicon\([^]*?\}\s*\);/.exec( 76 + code, 71 77 ); 72 78 if (!nsMatch) { 73 79 throw new Error("No lexicon definition found"); ··· 75 81 76 82 const cleanedCode = nsMatch[0]; 77 83 const wrappedCode = `${cleanedCode}\nreturn lex;`; 84 + // eslint-disable-next-line @typescript-eslint/no-implied-eval 78 85 const fn = new Function("lx", wrappedCode); 86 + 79 87 const result = fn(lx); 80 88 let typeInfo = "// Hover over .infer in the editor to see the type"; 81 89 ··· 137 145 } 138 146 }, 500); 139 147 140 - return () => clearTimeout(timeoutId); 148 + return () => { 149 + clearTimeout(timeoutId); 150 + }; 141 151 }, [code, monaco]); 142 152 143 153 return (
+1
packages/site/src/main.tsx
··· 4 4 import "./index.css"; 5 5 import { App } from "./App.tsx"; 6 6 7 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 7 8 createRoot(document.getElementById("root")!).render( 8 9 <StrictMode> 9 10 <NuqsAdapter>