.eslintrc.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. },
  6. extends: [
  7. 'eslint:recommended',
  8. 'plugin:@typescript-eslint/recommended',
  9. 'plugin:@typescript-eslint/recommended-requiring-type-checking',
  10. 'plugin:@typescript-eslint/eslint-recommended',
  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. project: ['tsconfig.json']
  34. },
  35. plugins: ['react', 'prettier', '@typescript-eslint', 'import'],
  36. rules: {
  37. 'prettier/prettier': ['warn', require('./.prettierrc.js')],
  38. 'react/react-in-jsx-scope': 'off',
  39. 'react/prop-types': 'off',
  40. 'react/display-name': 'off',
  41. 'react/no-unescaped-entities': 'off',
  42. 'no-unused-vars': 'off',
  43. '@typescript-eslint/no-unused-vars': 'warn',
  44. 'jsx-a11y/anchor-is-valid': 'off',
  45. 'jsx-a11y/accessible-emoji': 'warn',
  46. '@typescript-eslint/explicit-module-boundary-types': 'off',
  47. '@typescript-eslint/no-explicit-any': 'off',
  48. 'comma-dangle': [
  49. 'off',
  50. {
  51. arrays: 'ignore',
  52. objects: 'always',
  53. imports: 'never',
  54. exports: 'never',
  55. functions: 'ignore',
  56. },
  57. ],
  58. 'import/order': [
  59. 'warn',
  60. {
  61. alphabetize: { order: 'asc' },
  62. groups: [['index', 'external', 'internal', 'builtin', 'object'], 'parent', 'sibling'],
  63. },
  64. ],
  65. },
  66. settings: {
  67. react: {
  68. pragma: 'React',
  69. version: 'detect',
  70. },
  71. linkComponents: ['Hyperlink', { name: 'Link', linkAttribute: 'href' }],
  72. },
  73. };