.eslintrc.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/no-is-mounted': 'off',
  31. 'react/jsx-filename-extension': [
  32. 1,
  33. {
  34. extensions: ['.js', '.jsx', '.tsx'],
  35. },
  36. ],
  37. 'react/jsx-props-no-spreading': 'off',
  38. 'react/jsx-no-bind': 'off',
  39. 'react/function-component-definition': [
  40. 'warn',
  41. {
  42. namedComponents: 'arrow-function',
  43. unnamedComponents: 'arrow-function',
  44. },
  45. ],
  46. '@next/next/no-img-element': 'off',
  47. 'no-unused-vars': 'off',
  48. '@typescript-eslint/no-unused-vars': 'error',
  49. 'no-console': 'off',
  50. 'no-use-before-define': [0],
  51. '@typescript-eslint/no-use-before-define': [0],
  52. 'no-shadow': 'off',
  53. '@typescript-eslint/no-shadow': ['error'],
  54. 'no-restricted-exports': 'off',
  55. 'no-plusplus': 'off',
  56. 'react/jsx-no-target-blank': [
  57. 1,
  58. {
  59. allowReferrer: false,
  60. enforceDynamicLinks: 'always',
  61. },
  62. ],
  63. 'import/extensions': [
  64. 'error',
  65. 'ignorePackages',
  66. {
  67. js: 'never',
  68. jsx: 'never',
  69. ts: 'never',
  70. tsx: 'never',
  71. },
  72. ],
  73. 'import/no-extraneous-dependencies': [
  74. 'error',
  75. {
  76. devDependencies: ['**/*.stories.*', '**/.storybook/**/*.*'],
  77. peerDependencies: true,
  78. },
  79. ],
  80. 'import/no-unused-modules': [1, { unusedExports: true }],
  81. },
  82. settings: {
  83. 'import/resolver': {
  84. node: {
  85. extensions: ['.js', '.jsx', '.ts', '.tsx'],
  86. },
  87. },
  88. },
  89. };