eslint.base.cjs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. module.exports = {
  2. parser: '@typescript-eslint/parser',
  3. extends: [
  4. 'eslint:recommended',
  5. 'plugin:@typescript-eslint/recommended',
  6. 'plugin:react/recommended',
  7. ],
  8. plugins: [
  9. '@typescript-eslint',
  10. ],
  11. settings: {
  12. react: {
  13. version: '18.2.0', // can't detect b/c we don't use React. hardcode a recent version
  14. },
  15. },
  16. env: {
  17. es2022: true,
  18. },
  19. rules: {
  20. indent: ['error', 2, { SwitchCase: 1 }],
  21. semi: ['error', 'never'],
  22. quotes: ['error', 'single'],
  23. 'jsx-quotes': ['error', 'prefer-double'], // rethink this?
  24. 'comma-dangle': ['error', {
  25. 'arrays': 'always-multiline',
  26. 'objects': 'always-multiline',
  27. 'imports': 'always-multiline',
  28. 'exports': 'always-multiline',
  29. 'functions': 'always-multiline', // not included in single-value specification
  30. }],
  31. // typescript will check unknown vars, even for js (with checkJs)
  32. 'no-undef': 'off',
  33. // jsx
  34. 'react/react-in-jsx-scope': 'off', // not compat w/ Preact (checked in ts anyway)
  35. 'react/display-name': 'off',
  36. // easy fixes in near-term
  37. '@typescript-eslint/no-unused-vars': 'off',
  38. // hard fixes in long-term
  39. 'prefer-const': 'off',
  40. '@typescript-eslint/no-explicit-any': 'off',
  41. '@typescript-eslint/explicit-module-boundary-types': 'off',
  42. '@typescript-eslint/no-inferrable-types': 'off',
  43. '@typescript-eslint/no-empty-function': 'off',
  44. // legitimately want disabled
  45. '@typescript-eslint/no-empty-interface': 'off', // need empty interfaces for decl merging
  46. '@typescript-eslint/no-non-null-assertion': 'off',
  47. // TODO: merge rules from this legacy file:
  48. // https://github.com/fullcalendar/fullcalendar/blob/v5.11.3/.eslintrc.yml
  49. },
  50. overrides: [
  51. {
  52. files: '*.cjs', // at any depth
  53. rules: {
  54. '@typescript-eslint/no-var-requires': 'off', // allow require() statements
  55. },
  56. },
  57. ],
  58. }