.eslintrc.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. },
  6. extends: [
  7. 'eslint:recommended',
  8. 'plugin:@typescript-eslint/eslint-recommended',
  9. 'plugin:@typescript-eslint/recommended',
  10. 'plugin:@typescript-eslint/recommended-requiring-type-checking',
  11. 'plugin:jsx-a11y/recommended',
  12. 'plugin:react-hooks/recommended',
  13. 'next',
  14. 'next/core-web-vitals',
  15. ],
  16. ignorePatterns: [
  17. // break
  18. '**/node_modules/**',
  19. '**/dist/**',
  20. '**/.next/**',
  21. '**/.rush/**',
  22. '**/.serverless/**',
  23. '**/.serverless_nextjs/**',
  24. ],
  25. globals: { __dirname: true, process: true },
  26. parser: '@typescript-eslint/parser',
  27. parserOptions: {
  28. ecmaFeatures: {
  29. jsx: true,
  30. },
  31. ecmaVersion: 12,
  32. sourceType: 'module',
  33. },
  34. plugins: ['react', 'prettier', '@typescript-eslint', 'import'],
  35. rules: {
  36. 'prettier/prettier': ['warn', require('./.prettierrc.js')],
  37. 'react/react-in-jsx-scope': 'off',
  38. 'react/prop-types': 'off',
  39. 'react/display-name': 'off',
  40. 'react/no-unescaped-entities': 'off',
  41. 'no-unused-vars': 'warn',
  42. 'jsx-a11y/anchor-is-valid': 'off',
  43. 'jsx-a11y/accessible-emoji': 'warn',
  44. '@typescript-eslint/explicit-module-boundary-types': 'off',
  45. '@typescript-eslint/no-explicit-any': 'off',
  46. 'comma-dangle': [
  47. 'off',
  48. {
  49. arrays: 'ignore',
  50. objects: 'always',
  51. imports: 'never',
  52. exports: 'never',
  53. functions: 'ignore',
  54. },
  55. ],
  56. 'import/order': [
  57. 'warn',
  58. {
  59. alphabetize: { order: 'asc' },
  60. groups: [['index', 'external', 'internal', 'builtin', 'object'], 'parent', 'sibling'],
  61. },
  62. ],
  63. },
  64. settings: {
  65. react: {
  66. pragma: 'React',
  67. version: 'detect',
  68. },
  69. linkComponents: ['Hyperlink', { name: 'Link', linkAttribute: 'href' }],
  70. },
  71. };