.eslintrc.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. module.exports = {
  2. extends: ['eslint:recommended', 'plugin:compat/recommended', 'prettier'],
  3. globals: {
  4. self: false
  5. },
  6. env: {
  7. node: true,
  8. es6: true
  9. },
  10. rules: {
  11. 'no-console': 'warn',
  12. // temporarily disabled until the violating places are fixed.
  13. 'no-func-assign': 'off',
  14. 'no-sparse-arrays': 'off',
  15. // Best Practices //
  16. //----------------//
  17. 'default-case': 'warn',
  18. 'guard-for-in': 'warn',
  19. 'no-alert': 'error',
  20. 'no-caller': 'error',
  21. 'no-div-regex': 'warn',
  22. 'no-eval': 'error',
  23. 'no-extend-native': 'error',
  24. 'no-extra-bind': 'error',
  25. 'no-floating-decimal': 'error',
  26. 'no-implied-eval': 'error',
  27. 'no-iterator': 'error',
  28. 'no-labels': 'error',
  29. 'no-lone-blocks': 'error',
  30. 'no-loop-func': 'error',
  31. 'no-multi-str': 'warn',
  32. 'no-global-assign': 'error',
  33. 'no-new': 'error',
  34. 'no-new-func': 'error',
  35. 'no-new-wrappers': 'error',
  36. 'no-octal-escape': 'error',
  37. 'no-process-env': 'error',
  38. 'no-proto': 'error',
  39. 'no-return-assign': 'error',
  40. 'no-script-url': 'error',
  41. 'no-self-compare': 'error',
  42. 'no-sequences': 'error',
  43. 'no-throw-literal': 'error',
  44. 'no-unused-expressions': 'error',
  45. 'no-warning-comments': 'warn',
  46. 'no-with': 'error',
  47. radix: 'error',
  48. // Variables //
  49. //-----------//
  50. 'no-label-var': 'error',
  51. 'no-undef-init': 'error',
  52. 'no-use-before-define': ['error', 'nofunc'],
  53. // ECMAScript 6 //
  54. //--------------//
  55. 'no-var': 'error'
  56. },
  57. parserOptions: {
  58. sourceType: 'module',
  59. ecmaVersion: 6,
  60. ecmaFeatures: {}
  61. }
  62. };