.eslintrc.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. module.exports = {
  2. 'parser': '@typescript-eslint/parser',
  3. 'extends': 'eslint:recommended',
  4. 'parserOptions': {
  5. 'ecmaVersion': 2018,
  6. 'sourceType': 'module'
  7. },
  8. 'plugins': ['@typescript-eslint'],
  9. 'env': {
  10. 'browser': true,
  11. 'node': true,
  12. 'mocha': true
  13. },
  14. 'globals': {},
  15. 'rules': {
  16. indent: ['error', 4, {
  17. SwitchCase: 1
  18. }],
  19. 'no-empty': ['error', { 'allowEmptyCatch': true }],
  20. quotes: ['error', 'single', {
  21. avoidEscape: true
  22. }],
  23. /**
  24. * The codebase uses some while(true) statements.
  25. * Refactor to remove this rule.
  26. */
  27. 'no-constant-condition': 0,
  28. /**
  29. * Less combines assignments with conditionals sometimes
  30. */
  31. 'no-cond-assign': 0,
  32. /**
  33. * @todo - remove when some kind of code style (XO?) is added
  34. */
  35. 'no-multiple-empty-lines': 'error'
  36. },
  37. 'overrides': [
  38. {
  39. files: ['*.ts'],
  40. extends: ['plugin:@typescript-eslint/recommended'],
  41. rules: {
  42. /**
  43. * Suppress until Less has better-defined types
  44. * @see https://github.com/less/less.js/discussions/3786
  45. */
  46. '@typescript-eslint/no-explicit-any': 0
  47. }
  48. },
  49. {
  50. files: ['test/**/*.{js,ts}', 'benchmark/index.js'],
  51. /**
  52. * @todo - fix later
  53. */
  54. rules: {
  55. 'no-undef': 0,
  56. 'no-useless-escape': 0,
  57. 'no-unused-vars': 0,
  58. 'no-redeclare': 0,
  59. '@typescript-eslint/no-unused-vars': 0
  60. }
  61. },
  62. ]
  63. }