.eslintrc.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. ],
  7. plugins: [
  8. 'regex',
  9. ],
  10. rules: {
  11. 'import/prefer-default-export': 'off',
  12. 'import/order': [
  13. 'warn',
  14. {
  15. pathGroups: [
  16. {
  17. pattern: 'react',
  18. group: 'builtin',
  19. position: 'before',
  20. },
  21. {
  22. pattern: '^/**',
  23. group: 'parent',
  24. position: 'before',
  25. },
  26. {
  27. pattern: '~/**',
  28. group: 'parent',
  29. position: 'before',
  30. },
  31. {
  32. pattern: '*.css',
  33. group: 'type',
  34. patternOptions: { matchBase: true },
  35. position: 'after',
  36. },
  37. {
  38. pattern: '*.scss',
  39. group: 'type',
  40. patternOptions: { matchBase: true },
  41. position: 'after',
  42. },
  43. ],
  44. alphabetize: {
  45. order: 'asc',
  46. },
  47. pathGroupsExcludedImportTypes: ['react'],
  48. 'newlines-between': 'always',
  49. },
  50. ],
  51. '@typescript-eslint/no-explicit-any': 'off',
  52. '@typescript-eslint/explicit-module-boundary-types': 'off',
  53. indent: [
  54. 'error',
  55. 2,
  56. {
  57. SwitchCase: 1,
  58. ArrayExpression: 'first',
  59. FunctionDeclaration: { body: 1, parameters: 2 },
  60. FunctionExpression: { body: 1, parameters: 2 },
  61. },
  62. ],
  63. 'regex/invalid': ['error', [
  64. {
  65. regex: '\\?\\<\\!',
  66. message: 'Do not use any negative lookbehind',
  67. }, {
  68. regex: '\\?\\<\\=',
  69. message: 'Do not use any Positive lookbehind',
  70. },
  71. ]],
  72. },
  73. overrides: [
  74. {
  75. // enable the rule specifically for TypeScript files
  76. files: ['*.ts', '*.tsx'],
  77. rules: {
  78. '@typescript-eslint/explicit-module-boundary-types': ['error'],
  79. },
  80. },
  81. ],
  82. };