eslint.config.mjs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // @ts-check
  2. import eslint from '@eslint/js';
  3. import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
  4. import globals from 'globals';
  5. import tseslint from 'typescript-eslint';
  6. export default tseslint.config(
  7. {
  8. ignores: ['eslint.config.mjs'],
  9. },
  10. eslint.configs.recommended,
  11. ...tseslint.configs.recommendedTypeChecked,
  12. eslintPluginPrettierRecommended,
  13. {
  14. languageOptions: {
  15. globals: {
  16. ...globals.node,
  17. ...globals.jest,
  18. },
  19. sourceType: 'commonjs',
  20. parserOptions: {
  21. projectService: true,
  22. tsconfigRootDir: import.meta.dirname,
  23. },
  24. },
  25. },
  26. {
  27. rules: {
  28. '@typescript-eslint/no-explicit-any': 'off',
  29. '@typescript-eslint/no-floating-promises': 'warn',
  30. '@typescript-eslint/no-unsafe-argument': 'warn',
  31. '@typescript-eslint/no-unsafe-assignment': 'warn',
  32. '@typescript-eslint/no-unsafe-member-access': 'warn',
  33. '@typescript-eslint/no-unsafe-call': 'warn',
  34. '@typescript-eslint/no-unsafe-return': 'warn',
  35. '@typescript-eslint/no-unused-vars': 'warn',
  36. '@typescript-eslint/unbound-method': 'warn',
  37. '@typescript-eslint/require-await': 'warn',
  38. '@typescript-eslint/no-require-imports': 'warn',
  39. 'prettier/prettier': ['error', { endOfLine: 'auto' }],
  40. },
  41. },
  42. );