mirror of
https://github.com/EdiFarcas/Giveaway-app.git
synced 2026-06-22 05:00:55 +03:00
lint rules update
This commit is contained in:
+29
-14
@@ -1,16 +1,31 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
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({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
export default defineConfig([
|
||||
{ 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,
|
||||
{
|
||||
...pluginReact.configs.flat.recommended,
|
||||
rules: {
|
||||
...pluginReact.configs.flat.recommended.rules,
|
||||
"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,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
||||
Generated
+300
-963
File diff suppressed because it is too large
Load Diff
+6
-2
@@ -21,14 +21,18 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@eslint/js": "^9.27.0",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint": "^9",
|
||||
"eslint": "^9.27.0",
|
||||
"eslint-config-next": "15.3.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"globals": "^16.1.0",
|
||||
"prisma": "^6.7.0",
|
||||
"tailwindcss": "^4.1.4",
|
||||
"typescript": "^5"
|
||||
"typescript": "^5",
|
||||
"typescript-eslint": "^8.32.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ const handleUpdateCoins = async (youtubeUrl: string, coinValue: number) => {
|
||||
);
|
||||
|
||||
const pageAuthors = response.data.items.map(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(item: any) => item.snippet.topLevelComment.snippet.authorDisplayName
|
||||
);
|
||||
allAuthors.push(...pageAuthors);
|
||||
|
||||
@@ -27,6 +27,7 @@ export const authOptions = {
|
||||
strategy: "database" as SessionStrategy,
|
||||
},
|
||||
callbacks: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async signIn({ user, account, profile }: { user: any; account: any; profile?: any }) {
|
||||
if (!user || !account || !profile) {
|
||||
console.error("Sign-in failed: Missing user, account, or profile data.");
|
||||
@@ -62,6 +63,7 @@ export const authOptions = {
|
||||
|
||||
return true;
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async session({ session, user }: { session: any; user: any }) {
|
||||
session.user.id = user.id;
|
||||
session.user.youtubeHandle = user.youtubeHandle; // Only attach YouTube handle
|
||||
|
||||
Reference in New Issue
Block a user