.eslintrc.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /**
  2. * @type {import('eslint').Linter.Config}
  3. */
  4. module.exports = {
  5. extends: ['next/core-web-vitals', 'weseek/react'],
  6. plugins: [],
  7. ignorePatterns: [
  8. 'dist/**',
  9. '**/dist/**',
  10. 'transpiled/**',
  11. 'public/**',
  12. 'src/linter-checker/**',
  13. 'tmp/**',
  14. 'next-env.d.ts',
  15. 'next.config.js',
  16. 'playwright.config.ts',
  17. 'test/integration/global-setup.js',
  18. 'test/integration/global-teardown.js',
  19. 'test/integration/setup-crowi.ts',
  20. 'test/integration/crowi/**',
  21. 'test/integration/middlewares/**',
  22. 'test/integration/migrations/**',
  23. 'test/integration/models/**',
  24. 'test/integration/service/**',
  25. 'test/integration/setup.js',
  26. 'playwright/**',
  27. 'test-with-vite/**',
  28. 'public/**',
  29. 'bin/**',
  30. 'config/**',
  31. 'src/styles/**',
  32. 'src/linter-checker/**',
  33. 'src/migrations/**',
  34. 'src/models/**',
  35. 'src/features/callout/**',
  36. 'src/features/collaborative-editor/**',
  37. 'src/features/comment/**',
  38. 'src/features/templates/**',
  39. 'src/features/mermaid/**',
  40. 'src/features/search/**',
  41. 'src/features/plantuml/**',
  42. 'src/features/external-user-group/**',
  43. 'src/features/page-bulk-export/**',
  44. 'src/features/growi-plugin/**',
  45. 'src/features/opentelemetry/**',
  46. 'src/features/openai/**',
  47. 'src/features/rate-limiter/**',
  48. 'src/stores-universal/**',
  49. 'src/interfaces/**',
  50. 'src/utils/**',
  51. 'src/components/**',
  52. 'src/services/**',
  53. 'src/states/**',
  54. 'src/stores/**',
  55. 'src/pages/**',
  56. 'src/server/crowi/**',
  57. 'src/server/events/**',
  58. 'src/server/interfaces/**',
  59. 'src/server/models/**',
  60. 'src/server/util/**',
  61. 'src/server/app.ts',
  62. 'src/server/repl.ts',
  63. 'src/server/middlewares/**',
  64. 'src/server/routes/*.js',
  65. 'src/server/routes/*.ts',
  66. 'src/server/routes/attachment/**',
  67. ],
  68. settings: {
  69. // resolve path aliases by eslint-import-resolver-typescript
  70. 'import/resolver': {
  71. typescript: {},
  72. },
  73. },
  74. rules: {
  75. 'space-before-function-paren': 'off',
  76. '@typescript-eslint/no-var-requires': 'off',
  77. // set 'warn' temporarily -- 2021.08.02 Yuki Takei
  78. '@typescript-eslint/no-use-before-define': ['warn'],
  79. '@typescript-eslint/no-this-alias': ['warn'],
  80. },
  81. overrides: [
  82. {
  83. // enable the rule specifically for JavaScript files
  84. files: ['*.js', '*.mjs', '*.jsx'],
  85. rules: {
  86. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  87. 'react/prop-types': 'warn',
  88. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  89. 'no-unused-vars': ['warn'],
  90. },
  91. },
  92. {
  93. // enable the rule specifically for TypeScript files
  94. files: ['*.ts', '*.mts', '*.tsx'],
  95. rules: {
  96. 'no-unused-vars': 'off',
  97. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  98. 'react/prop-types': 'warn',
  99. // set 'warn' temporarily -- 2022.07.25 Yuki Takei
  100. '@typescript-eslint/explicit-module-boundary-types': ['warn'],
  101. },
  102. },
  103. ],
  104. };