fix(eslint): resolve TypeScript imports require lint rules and prefer-const warnings
This commit is contained in:
@@ -420,8 +420,8 @@ export function StructuredViewBlockEmbed({
|
|||||||
setEchoLoading(false)
|
setEchoLoading(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let res = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`)
|
const res = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`)
|
||||||
let json = await res.json()
|
const json = await res.json()
|
||||||
|
|
||||||
let data = (json.success && Array.isArray(json.data)) ? json.data : []
|
let data = (json.success && Array.isArray(json.data)) ? json.data : []
|
||||||
|
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ export function NotesStructuredTable({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let fallbackRes = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`)
|
const fallbackRes = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`)
|
||||||
let fallbackJson = await fallbackRes.json()
|
const fallbackJson = await fallbackRes.json()
|
||||||
|
|
||||||
let filteredNotes = (fallbackJson.success && Array.isArray(fallbackJson.data))
|
let filteredNotes = (fallbackJson.success && Array.isArray(fallbackJson.data))
|
||||||
? fallbackJson.data.filter((n: any) => n.id !== noteId)
|
? fallbackJson.data.filter((n: any) => n.id !== noteId)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const require = createRequire(import.meta.url);
|
|||||||
// Manually configure Next.js ESLint without React Compiler plugin
|
// Manually configure Next.js ESLint without React Compiler plugin
|
||||||
const nextWebVitals = require("eslint-config-next/core-web-vitals");
|
const nextWebVitals = require("eslint-config-next/core-web-vitals");
|
||||||
const nextTypeScript = require("eslint-config-next/typescript");
|
const nextTypeScript = require("eslint-config-next/typescript");
|
||||||
|
const reactHooks = require("eslint-plugin-react-hooks");
|
||||||
|
|
||||||
// React Compiler rules to disable (from eslint-plugin-react-hooks v5+)
|
// React Compiler rules to disable (from eslint-plugin-react-hooks v5+)
|
||||||
// See: https://react.dev/learn/react-compiler
|
// See: https://react.dev/learn/react-compiler
|
||||||
@@ -54,6 +55,9 @@ const eslintConfig = defineConfig([
|
|||||||
"tests/**",
|
"tests/**",
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
|
plugins: {
|
||||||
|
"react-hooks": reactHooks,
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
...reactCompilerRules,
|
...reactCompilerRules,
|
||||||
"react-hooks/rules-of-hooks": "error",
|
"react-hooks/rules-of-hooks": "error",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|||||||
Reference in New Issue
Block a user