.eslintrc.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. jest: true,
  6. },
  7. extends: [
  8. 'plugin:react/recommended',
  9. 'airbnb',
  10. 'prettier',
  11. 'plugin:@next/next/recommended',
  12. 'plugin:storybook/recommended',
  13. ],
  14. parser: '@typescript-eslint/parser',
  15. parserOptions: {
  16. ecmaFeatures: {
  17. jsx: true,
  18. },
  19. ecmaVersion: 12,
  20. sourceType: 'module',
  21. },
  22. plugins: ['react', 'prettier', '@typescript-eslint', 'import'],
  23. ignorePatterns: ['!./storybook/**'],
  24. rules: {
  25. 'prettier/prettier': 'error',
  26. 'react/destructuring-assignment': 'off',
  27. 'react/prop-types': 0,
  28. 'react/react-in-jsx-scope': 'off',
  29. 'react/require-default-props': 'off',
  30. 'react/jsx-filename-extension': [
  31. 1,
  32. {
  33. extensions: ['.js', '.jsx', '.tsx'],
  34. },
  35. ],
  36. 'react/jsx-props-no-spreading': 'off',
  37. 'react/jsx-no-bind': 'off',
  38. 'react/function-component-definition': [
  39. 'warn',
  40. {
  41. namedComponents: 'arrow-function',
  42. unnamedComponents: 'arrow-function',
  43. },
  44. ],
  45. '@next/next/no-img-element': 'off',
  46. 'no-unused-vars': 'off',
  47. '@typescript-eslint/no-unused-vars': 'error',
  48. 'no-console': 'off',
  49. 'no-use-before-define': [0],
  50. '@typescript-eslint/no-use-before-define': [0],
  51. 'no-shadow': 'off',
  52. '@typescript-eslint/no-shadow': ['error'],
  53. 'no-restricted-exports': 'off',
  54. 'react/jsx-no-target-blank': [
  55. 1,
  56. {
  57. allowReferrer: false,
  58. enforceDynamicLinks: 'always',
  59. },
  60. ],
  61. 'import/extensions': [
  62. 'error',
  63. 'ignorePackages',
  64. {
  65. js: 'never',
  66. jsx: 'never',
  67. ts: 'never',
  68. tsx: 'never',
  69. },
  70. ],
  71. 'import/no-extraneous-dependencies': [
  72. 'error',
  73. {
  74. devDependencies: ['**/*.stories.*', '**/.storybook/**/*.*'],
  75. peerDependencies: true,
  76. },
  77. ],
  78. 'import/no-unused-modules': [1, { unusedExports: true }],
  79. },
  80. settings: {
  81. 'import/resolver': {
  82. node: {
  83. extensions: ['.js', '.jsx', '.ts', '.tsx'],
  84. },
  85. },
  86. },
  87. };