eslint.config.mjs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import ljharbConfig from '@ljharb/eslint-config/flat';
  2. export default [
  3. {
  4. ignores: ['dist/'],
  5. },
  6. ...ljharbConfig,
  7. {
  8. rules: {
  9. complexity: 'off',
  10. 'consistent-return': 'warn',
  11. eqeqeq: ['error', 'allow-null'],
  12. 'func-name-matching': 'off',
  13. 'id-length': [
  14. 'error',
  15. {
  16. max: 25,
  17. min: 1,
  18. properties: 'never',
  19. },
  20. ],
  21. indent: ['error', 4],
  22. 'max-lines': 'off',
  23. 'max-lines-per-function': [
  24. 'error',
  25. { max: 150 },
  26. ],
  27. 'max-params': ['error', 18],
  28. 'max-statements': ['error', 100],
  29. 'multiline-comment-style': 'off',
  30. 'no-continue': 'warn',
  31. 'no-magic-numbers': 'off',
  32. 'no-restricted-syntax': [
  33. 'error',
  34. 'BreakStatement',
  35. 'DebuggerStatement',
  36. 'ForInStatement',
  37. 'LabeledStatement',
  38. 'WithStatement',
  39. ],
  40. },
  41. },
  42. {
  43. files: ['test/**'],
  44. rules: {
  45. 'function-paren-newline': 'off',
  46. 'max-lines-per-function': 'off',
  47. 'max-statements': 'off',
  48. 'no-buffer-constructor': 'off',
  49. 'no-extend-native': 'off',
  50. 'no-throw-literal': 'off',
  51. },
  52. },
  53. ];