.eslintrc.cjs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* ESLint 8 flat-file predecessor config. This file is .cjs rather than .js
  2. because package.json sets "type": "module", which would otherwise make
  3. ESLint try to read this as an ES module. */
  4. module.exports = {
  5. root: true,
  6. env: {
  7. browser: true,
  8. es2020: true,
  9. node: true,
  10. },
  11. extends: [
  12. 'eslint:recommended',
  13. 'plugin:@typescript-eslint/recommended',
  14. 'plugin:react-hooks/recommended',
  15. ],
  16. parser: '@typescript-eslint/parser',
  17. parserOptions: {
  18. ecmaVersion: 'latest',
  19. sourceType: 'module',
  20. ecmaFeatures: { jsx: true },
  21. },
  22. plugins: ['@typescript-eslint', 'react-hooks'],
  23. ignorePatterns: ['dist', 'node_modules', '*.cjs'],
  24. rules: {
  25. // TypeScript already reports unused values through noUnusedLocals, and
  26. // the base rule double-reports on type-only declarations.
  27. 'no-unused-vars': 'off',
  28. '@typescript-eslint/no-unused-vars': [
  29. 'warn',
  30. { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
  31. ],
  32. // The codebase passes API payloads and ReactFlow node data around as
  33. // any in a lot of places. Worth tightening later, not worth failing
  34. // the build over today.
  35. '@typescript-eslint/no-explicit-any': 'off',
  36. // tsc enforces this far more accurately than the lint rule does.
  37. '@typescript-eslint/no-empty-function': 'off',
  38. },
  39. };