comments.ts 596 B

12345678910111213141516171819202122
  1. import type { Linter } from 'eslint';
  2. export async function comments(): Promise<Linter.FlatConfig[]> {
  3. const [pluginComments] = await Promise.all([
  4. // @ts-expect-error - no types
  5. import('eslint-plugin-eslint-comments'),
  6. ] as const);
  7. return [
  8. {
  9. plugins: {
  10. 'eslint-comments': pluginComments,
  11. },
  12. rules: {
  13. 'eslint-comments/no-aggregating-enable': 'error',
  14. 'eslint-comments/no-duplicate-disable': 'error',
  15. 'eslint-comments/no-unlimited-disable': 'error',
  16. 'eslint-comments/no-unused-enable': 'error',
  17. },
  18. },
  19. ];
  20. }