.eslintrc.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. ],
  20. settings: {
  21. // resolve path aliases by eslint-import-resolver-typescript
  22. 'import/resolver': {
  23. typescript: {},
  24. },
  25. },
  26. rules: {
  27. 'no-restricted-imports': ['error', {
  28. name: 'axios',
  29. message: 'Please use src/utils/axios instead.',
  30. }],
  31. '@typescript-eslint/no-var-requires': 'off',
  32. // set 'warn' temporarily -- 2021.08.02 Yuki Takei
  33. '@typescript-eslint/no-use-before-define': ['warn'],
  34. '@typescript-eslint/no-this-alias': ['warn'],
  35. },
  36. overrides: [
  37. {
  38. // enable the rule specifically for JavaScript files
  39. files: ['*.js', '*.mjs', '*.jsx'],
  40. rules: {
  41. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  42. 'react/prop-types': 'warn',
  43. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  44. 'no-unused-vars': ['warn'],
  45. },
  46. },
  47. {
  48. // enable the rule specifically for TypeScript files
  49. files: ['*.ts', '*.mts', '*.tsx'],
  50. rules: {
  51. 'no-unused-vars': 'off',
  52. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  53. 'react/prop-types': 'warn',
  54. // set 'warn' temporarily -- 2022.07.25 Yuki Takei
  55. '@typescript-eslint/explicit-module-boundary-types': ['warn'],
  56. },
  57. },
  58. ],
  59. };