.eslintrc.js 1.7 KB

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