.eslintrc.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. '@typescript-eslint/consistent-type-imports': 'warn',
  31. // set 'warn' temporarily -- 2021.08.02 Yuki Takei
  32. '@typescript-eslint/no-use-before-define': ['warn'],
  33. '@typescript-eslint/no-this-alias': ['warn'],
  34. },
  35. overrides: [
  36. {
  37. // enable the rule specifically for JavaScript files
  38. files: ['*.js', '*.jsx'],
  39. rules: {
  40. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  41. 'react/prop-types': 'warn',
  42. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  43. 'no-unused-vars': ['warn'],
  44. },
  45. },
  46. {
  47. // enable the rule specifically for TypeScript files
  48. files: ['*.ts', '*.tsx'],
  49. rules: {
  50. 'no-unused-vars': 'off',
  51. // set 'warn' temporarily -- 2023.08.14 Yuki Takei
  52. 'react/prop-types': 'warn',
  53. // set 'warn' temporarily -- 2022.07.25 Yuki Takei
  54. '@typescript-eslint/explicit-module-boundary-types': ['warn'],
  55. },
  56. },
  57. ],
  58. };