Skip to content

Instantly share code, notes, and snippets.

@barisbll
Created May 17, 2025 10:29
Show Gist options
  • Save barisbll/d1af00e0ed291365b2cbb7cfc52243ca to your computer and use it in GitHub Desktop.
Save barisbll/d1af00e0ed291365b2cbb7cfc52243ca to your computer and use it in GitHub Desktop.
Nextjs15 eslint.config
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
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"),
{
rules: {
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1, maxBOF: 0 }],
"react/jsx-indent": ["error", 2],
"react/jsx-indent-props": ["error", 2],
"indent": ["error", 2, { "SwitchCase": 1 }],
"jsx-quotes": ["error", "prefer-double"],
"react/jsx-closing-bracket-location": ["error", "line-aligned"],
"react/jsx-closing-tag-location": "error",
"react/jsx-tag-spacing": ["error", {
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}]
},
},
];
export default eslintConfig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment