.eslintrc.js 2.5 KB

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