.eslintrc.js 1.1 KB

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