eslint.config.mjs 959 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { dirname } from 'path'
  2. import { fileURLToPath } from 'url'
  3. import { FlatCompat } from '@eslint/eslintrc'
  4. const __filename = fileURLToPath(import.meta.url)
  5. const __dirname = dirname(__filename)
  6. const compat = new FlatCompat({
  7. baseDirectory: __dirname,
  8. })
  9. const eslintConfig = [
  10. ...compat.extends('next/core-web-vitals', 'next/typescript'),
  11. {
  12. rules: {
  13. '@typescript-eslint/ban-ts-comment': 'warn',
  14. '@typescript-eslint/no-empty-object-type': 'warn',
  15. '@typescript-eslint/no-explicit-any': 'warn',
  16. '@typescript-eslint/no-unused-vars': [
  17. 'warn',
  18. {
  19. vars: 'all',
  20. args: 'after-used',
  21. ignoreRestSiblings: false,
  22. argsIgnorePattern: '^_',
  23. varsIgnorePattern: '^_',
  24. destructuredArrayIgnorePattern: '^_',
  25. caughtErrorsIgnorePattern: '^(_|ignore)',
  26. },
  27. ],
  28. },
  29. },
  30. {
  31. ignores: ['.next/'],
  32. },
  33. ]
  34. export default eslintConfig