.eslintrc.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/setup.js',
  29. 'bin/**',
  30. 'config/**',
  31. 'src/linter-checker/**',
  32. 'src/migrations/**',
  33. 'src/features/callout/**',
  34. 'src/features/comment/**',
  35. 'src/features/templates/**',
  36. 'src/features/mermaid/**',
  37. 'src/features/search/**',
  38. 'src/features/plantuml/**',
  39. 'src/features/external-user-group/**',
  40. 'src/features/page-bulk-export/**',
  41. 'src/features/opentelemetry/**',
  42. 'src/stores-universal/**',
  43. 'src/interfaces/**',
  44. 'src/utils/**',
  45. ],
  46. settings: {
  47. // resolve path aliases by eslint-import-resolver-typescript
  48. 'import/resolver': {
  49. typescript: {},
  50. },
  51. },
  52. rules: {
  53. 'no-restricted-imports': ['error', {
  54. name: 'axios',
  55. message: 'Please use src/utils/axios instead.',
  56. }],
  57. '@typescript-eslint/no-var-requires': 'off',
  58. // set 'warn' temporarily -- 2021.08.02 Yuki Takei
  59. '@typescript-eslint/no-use-before-define': ['warn'],
  60. '@typescript-eslint/no-this-alias': ['warn'],
  61. },
  62. overrides: [
  63. {
  64. // enable the rule specifically for JavaScript files
  65. files: ['*.js', '*.mjs', '*.jsx'],
  66. rules: {
  67. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  68. 'react/prop-types': 'warn',
  69. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  70. 'no-unused-vars': ['warn'],
  71. },
  72. },
  73. {
  74. // enable the rule specifically for TypeScript files
  75. files: ['*.ts', '*.mts', '*.tsx'],
  76. rules: {
  77. 'no-unused-vars': 'off',
  78. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  79. 'react/prop-types': 'warn',
  80. // set 'warn' temporarily -- 2022.07.25 Yuki Takei
  81. '@typescript-eslint/explicit-module-boundary-types': ['warn'],
  82. },
  83. },
  84. ],
  85. };