.eslintrc.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. module.exports = {
  2. root: true, // https://eslint.org/docs/user-guide/configuring/configuration-files#cascading-and-hierarchy
  3. extends: [
  4. 'weseek',
  5. 'weseek/typescript',
  6. 'plugin:jest/recommended',
  7. ],
  8. env: {
  9. 'jest/globals': true,
  10. },
  11. globals: {
  12. },
  13. plugins: [
  14. 'jest',
  15. 'regex',
  16. ],
  17. rules: {
  18. 'import/prefer-default-export': 'off',
  19. 'import/order': [
  20. 'warn',
  21. {
  22. pathGroups: [
  23. {
  24. pattern: 'react',
  25. group: 'builtin',
  26. position: 'before',
  27. },
  28. {
  29. pattern: '^/**',
  30. group: 'parent',
  31. position: 'before',
  32. },
  33. {
  34. pattern: '~/**',
  35. group: 'parent',
  36. position: 'before',
  37. },
  38. {
  39. pattern: '*.css',
  40. group: 'type',
  41. patternOptions: { matchBase: true },
  42. position: 'after',
  43. },
  44. {
  45. pattern: '*.scss',
  46. group: 'type',
  47. patternOptions: { matchBase: true },
  48. position: 'after',
  49. },
  50. ],
  51. alphabetize: {
  52. order: 'asc',
  53. },
  54. pathGroupsExcludedImportTypes: ['react'],
  55. 'newlines-between': 'always',
  56. },
  57. ],
  58. '@typescript-eslint/no-explicit-any': 'off',
  59. indent: [
  60. 'error',
  61. 2,
  62. {
  63. SwitchCase: 1,
  64. ArrayExpression: 'first',
  65. FunctionDeclaration: { body: 1, parameters: 2 },
  66. FunctionExpression: { body: 1, parameters: 2 },
  67. },
  68. ],
  69. 'jest/no-standalone-expect': [
  70. 'error',
  71. { additionalTestBlockFunctions: ['each.test'] },
  72. ],
  73. 'regex/invalid': ['error', [
  74. {
  75. regex: '\\?\\<\\!',
  76. message: 'Do not use any negative lookbehind',
  77. }, {
  78. regex: '\\?\\<\\=',
  79. message: 'Do not use any Positive lookbehind',
  80. },
  81. ]],
  82. },
  83. };