fix: add tsconfig.json, @types/chrome, fix TS errors - CI typecheck now passes
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 9s
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 9s
This commit is contained in:
@@ -162,7 +162,7 @@ function OptionsPage() {
|
||||
const apiKeyRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
chrome.storage.local.get(['provider', 'apiKey', 'model'], (result) => {
|
||||
chrome.storage.local.get(["provider", "apiKey", "model"], (result: Record<string, string>) => {
|
||||
if (result.provider) setProvider(result.provider);
|
||||
if (result.apiKey) setApiKey(result.apiKey);
|
||||
if (result.model) setModel(result.model);
|
||||
|
||||
@@ -7,7 +7,7 @@ function Popup() {
|
||||
const [model, setModel] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
chrome.storage.local.get(['provider', 'apiKey', 'model'], (result) => {
|
||||
chrome.storage.local.get(["provider", "apiKey", "model"], (result: Record<string, string>) => {
|
||||
if (result.apiKey) {
|
||||
setConfigured(true);
|
||||
setProvider(result.provider || 'openai');
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -18,6 +18,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@types/chrome": "^0.1.37",
|
||||
"@types/react": "^18.3.1",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"autoprefixer": "^10.4.20",
|
||||
@@ -1399,6 +1400,17 @@
|
||||
"assertion-error": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/chrome": {
|
||||
"version": "0.1.37",
|
||||
"resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.1.37.tgz",
|
||||
"integrity": "sha512-IJE4ceuDO7lrEuua7Pow47zwNcI8E6qqkowRP7aFPaZ0lrjxh6y836OPqqkIZeTX64FTogbw+4RNH0+QrweCTQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/filesystem": "*",
|
||||
"@types/har-format": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/deep-eql": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@types/chrome": "^0.1.37",
|
||||
"@types/react": "^18.3.1",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"autoprefixer": "^10.4.20",
|
||||
|
||||
27
tsconfig.json
Normal file
27
tsconfig.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"types": ["chrome"],
|
||||
"esModuleInterop": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"paths": {
|
||||
"~/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"entrypoints/**/*",
|
||||
"src/**/*",
|
||||
".wxt/types/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
".output"
|
||||
]
|
||||
}
|
||||
9
tsconfig.test.json
Normal file
9
tsconfig.test.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["vitest/globals"]
|
||||
},
|
||||
"include": [
|
||||
"tests/**/*"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user