31 lines
971 B
JavaScript
31 lines
971 B
JavaScript
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"),
|
|
{
|
|
extends: [
|
|
'plugin:prettier/recommended',
|
|
'plugin:jsx-a11y/recommended', // Add this line
|
|
],
|
|
rules: {
|
|
// Example: Enforce using `const` for variables that are never reassigned
|
|
'prefer-const': 'error',
|
|
// Example: Disallow unused variables (already often included in recommended configs, but shown for illustration)
|
|
'no-unused-vars': ['warn', { 'args': 'none' }],
|
|
// Example: Disable a rule if it conflicts with your style or Prettier (less common after plugin:prettier/recommended)
|
|
// 'indent': 'off',
|
|
},
|
|
},
|
|
];
|
|
|
|
export default eslintConfig;
|