Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"plugin:import/recommended",
"plugin:import/typescript"
],
"plugins": ["prettier", "import", "path-alias", "@typescript-eslint"],
"plugins": ["prettier", "import", "path-alias", "@typescript-eslint", "react-hooks", "react-compiler"],
"parser": "@typescript-eslint/parser",
"settings": {
"import/resolver": {
Expand All @@ -20,7 +20,10 @@
"import/first": "error",
"import/newline-after-import": "error",
"import/no-extraneous-dependencies": "error",
"import/order": ["error", { "alphabetize": { "order": "asc" } }]
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react-compiler/react-compiler": "error",
"import/default": "off"
},
"overrides": [
{
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dist
.idea
*.iml
.env*.local
package-lock.json
7 changes: 0 additions & 7 deletions api/new-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const config = {
async function readBody(readable: VercelRequest) {
const chunks = []
for await (const chunk of readable) {
// @ts-expect-error
chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk)
}
return Buffer.concat(chunks).toString('utf8')
Expand Down Expand Up @@ -172,12 +171,6 @@ export default async function (req: VercelRequest, res: VercelResponse) {
break
case 'contribution.starter':

return ['title', 'body'].every((key: string) => key in document)
? await getSpamScore(title, body, 4, TOKEN_LIMIT)
: { rating: 7, reasons: ['Lacks required fields'] }
break
case 'contribution.starter':

return ['title', 'body'].every((key: string) => key in document)
? await getSpamScore(title, body, 4, TOKEN_LIMIT)
: { rating: 7, reasons: ['Lacks required fields'] }
Expand Down
Loading