.eslintrc.js 1.3 KB

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