35 lines
848 B
JavaScript
35 lines
848 B
JavaScript
import { FlatCompat } from '@eslint/eslintrc';
|
|
import noRelativeImportPaths from 'eslint-plugin-no-relative-import-paths';
|
|
import { dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
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', 'prettier'),
|
|
{
|
|
ignores: ['src/generated/**', '.next/**', 'public/**'],
|
|
},
|
|
{
|
|
plugins: {
|
|
'no-relative-import-paths': noRelativeImportPaths,
|
|
},
|
|
rules: {
|
|
'no-relative-import-paths/no-relative-import-paths': [
|
|
'error',
|
|
{
|
|
allowSameFolder: true,
|
|
rootDir: 'src',
|
|
prefix: "@",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|
|
|
|
export default eslintConfig;
|