lint rules update

This commit is contained in:
Alexandru Eduard Farcas
2025-05-18 10:15:18 +03:00
parent e533cd2248
commit f8144fb5ac
5 changed files with 337 additions and 978 deletions
+29 -14
View File
@@ -1,16 +1,31 @@
import { dirname } from "path"; import js from "@eslint/js";
import { fileURLToPath } from "url"; import globals from "globals";
import { FlatCompat } from "@eslint/eslintrc"; import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import { defineConfig } from "eslint/config";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({ export default defineConfig([
baseDirectory: __dirname, { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], plugins: { js }, extends: ["js/recommended"] },
}); { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], languageOptions: { globals: {...globals.browser, ...globals.node} } },
tseslint.configs.recommended,
const eslintConfig = [ {
...compat.extends("next/core-web-vitals", "next/typescript"), ...pluginReact.configs.flat.recommended,
]; rules: {
...pluginReact.configs.flat.recommended.rules,
export default eslintConfig; "react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
"react/jsx-no-bind": [
"error",
{
ignoreRefs: true,
allowArrowFunctions: true,
allowFunctions: true,
allowBind: false,
},
],
},
}
]);
+300 -963
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -21,14 +21,18 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3", "@eslint/eslintrc": "^3",
"@eslint/js": "^9.27.0",
"@tailwindcss/postcss": "^4", "@tailwindcss/postcss": "^4",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^19", "@types/react": "^19",
"@types/react-dom": "^19", "@types/react-dom": "^19",
"eslint": "^9", "eslint": "^9.27.0",
"eslint-config-next": "15.3.1", "eslint-config-next": "15.3.1",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.1.0",
"prisma": "^6.7.0", "prisma": "^6.7.0",
"tailwindcss": "^4.1.4", "tailwindcss": "^4.1.4",
"typescript": "^5" "typescript": "^5",
"typescript-eslint": "^8.32.1"
} }
} }
+1
View File
@@ -48,6 +48,7 @@ const handleUpdateCoins = async (youtubeUrl: string, coinValue: number) => {
); );
const pageAuthors = response.data.items.map( const pageAuthors = response.data.items.map(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(item: any) => item.snippet.topLevelComment.snippet.authorDisplayName (item: any) => item.snippet.topLevelComment.snippet.authorDisplayName
); );
allAuthors.push(...pageAuthors); allAuthors.push(...pageAuthors);
+2
View File
@@ -27,6 +27,7 @@ export const authOptions = {
strategy: "database" as SessionStrategy, strategy: "database" as SessionStrategy,
}, },
callbacks: { callbacks: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async signIn({ user, account, profile }: { user: any; account: any; profile?: any }) { async signIn({ user, account, profile }: { user: any; account: any; profile?: any }) {
if (!user || !account || !profile) { if (!user || !account || !profile) {
console.error("Sign-in failed: Missing user, account, or profile data."); console.error("Sign-in failed: Missing user, account, or profile data.");
@@ -62,6 +63,7 @@ export const authOptions = {
return true; return true;
}, },
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async session({ session, user }: { session: any; user: any }) { async session({ session, user }: { session: any; user: any }) {
session.user.id = user.id; session.user.id = user.id;
session.user.youtubeHandle = user.youtubeHandle; // Only attach YouTube handle session.user.youtubeHandle = user.youtubeHandle; // Only attach YouTube handle