.eslintrc.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module.exports = {
  2. root: true,
  3. ignorePatterns: ['public/'],
  4. parserOptions: {
  5. parser: 'babel-eslint',
  6. ecmaVersion: 2018,
  7. sourceType: 'module',
  8. },
  9. plugins: ['html'],
  10. extends: ['plugin:prettier/recommended'],
  11. env: {
  12. browser: true,
  13. node: true,
  14. },
  15. rules: {
  16. 'prettier/prettier': [
  17. 'error',
  18. {
  19. endOfLine: 'auto',
  20. },
  21. ],
  22. indent: ['error', 2, { SwitchCase: 1 }],
  23. 'space-infix-ops': ['error', { int32Hint: false }],
  24. 'key-spacing': [
  25. 2,
  26. {
  27. beforeColon: false,
  28. afterColon: true,
  29. },
  30. ],
  31. 'no-octal': 2,
  32. 'no-redeclare': 2,
  33. 'comma-spacing': 2,
  34. 'no-new-object': 2,
  35. 'arrow-spacing': 2,
  36. quotes: [
  37. 2,
  38. 'single',
  39. {
  40. avoidEscape: true,
  41. allowTemplateLiterals: true,
  42. },
  43. ],
  44. },
  45. overrides: [
  46. {
  47. files: ['**/*.ts'],
  48. parser: '@typescript-eslint/parser',
  49. extends: [
  50. 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
  51. // 'prettier/@typescript-eslint',
  52. ],
  53. },
  54. ],
  55. }