.eslintrc.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. module.exports = {
  2. extends: [
  3. 'next/core-web-vitals',
  4. 'weseek/react',
  5. ],
  6. plugins: [
  7. 'regex',
  8. ],
  9. settings: {
  10. // resolve path aliases by eslint-import-resolver-typescript
  11. 'import/resolver': {
  12. typescript: {},
  13. },
  14. },
  15. rules: {
  16. 'no-restricted-imports': ['error', {
  17. name: 'axios',
  18. message: 'Please use src/utils/axios instead.',
  19. }],
  20. 'regex/invalid': ['error', [
  21. {
  22. regex: '\\?\\<\\!',
  23. message: 'Do not use any negative lookbehind',
  24. }, {
  25. regex: '\\?\\<\\=',
  26. message: 'Do not use any Positive lookbehind',
  27. },
  28. ]],
  29. '@typescript-eslint/no-var-requires': 'off',
  30. // set 'warn' temporarily -- 2021.08.02 Yuki Takei
  31. '@typescript-eslint/no-use-before-define': ['warn'],
  32. '@typescript-eslint/no-this-alias': ['warn'],
  33. },
  34. overrides: [
  35. {
  36. // enable the rule specifically for JavaScript files
  37. files: ['*.js', '*.jsx'],
  38. rules: {
  39. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  40. 'react/prop-types': 'warn',
  41. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  42. 'no-unused-vars': ['warn'],
  43. },
  44. },
  45. {
  46. // enable the rule specifically for TypeScript files
  47. files: ['*.ts', '*.tsx'],
  48. rules: {
  49. 'no-unused-vars': 'off',
  50. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  51. 'react/prop-types': 'warn',
  52. // set 'warn' temporarily -- 2022.07.25 Yuki Takei
  53. '@typescript-eslint/explicit-module-boundary-types': ['warn'],
  54. },
  55. },
  56. ],
  57. };