.eslintrc.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. module.exports = {
  2. extends: [ 'eslint:recommended',
  3. 'plugin:@typescript-eslint/recommended', 'plugin:jest/recommended', 'prettier'],
  4. env: {
  5. node: true,
  6. es6: true,
  7. jest: true,
  8. },
  9. parser: '@typescript-eslint/parser',
  10. plugins: ['@typescript-eslint', 'jest'],
  11. rules: {
  12. '@typescript-eslint/explicit-module-boundary-types': 'off',
  13. '@typescript-eslint/no-non-null-assertion': 'off',
  14. '@typescript-eslint/naming-convention': [
  15. 'error',
  16. {
  17. selector: 'default',
  18. format: ['camelCase'],
  19. },
  20. {
  21. selector: 'variable',
  22. format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
  23. },
  24. {
  25. selector: 'property',
  26. format: [], // Don't force format of object properties, so they can be ie.: { "Some thing": 123 }, { some_thing: 123 } etc.
  27. },
  28. {
  29. selector: 'accessor',
  30. format: ['camelCase', 'snake_case'],
  31. },
  32. {
  33. selector: 'enumMember',
  34. format: ['PascalCase'],
  35. },
  36. {
  37. selector: 'typeLike',
  38. format: [],
  39. custom: { regex: '^([A-Z][a-z0-9]*_?)+', match: true }, // combined PascalCase and snake_case to allow ie. OpeningType_Worker
  40. },
  41. {
  42. selector: 'classMethod',
  43. modifiers: ['static'],
  44. format: ['PascalCase'],
  45. },
  46. ],
  47. }
  48. }