Bez popisu

.eslintrc.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. module.exports = {
  2. // Airbnb is the base, prettier is here so that eslint doesn't conflict with prettier
  3. extends: ['airbnb', 'prettier', 'prettier/react'],
  4. parser: 'typescript-eslint-parser',
  5. plugins: ['react-native', 'typescript'],
  6. rules: {
  7. // Parens will be needed for arrow functions
  8. 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
  9. // Lines will be broken before binary operators
  10. 'operator-linebreak': ['error', 'before'],
  11. // Allow imports from dev and peer dependencies
  12. 'import/no-extraneous-dependencies': [
  13. 'error',
  14. { devDependencies: true, peerDependencies: true },
  15. ],
  16. // Allows writing JSX in TSX files only
  17. 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
  18. // This rule doesn't play nice with Prettier
  19. 'react/jsx-one-expression-per-line': 'off',
  20. // This rule doesn't play nice with Prettier
  21. 'react/jsx-wrap-multilines': 'off',
  22. // Remove this rule because we only destructure props, but never state
  23. 'react/destructuring-assignment': 'off',
  24. 'typescript/adjacent-overload-signatures': 'error',
  25. 'typescript/explicit-function-return-type': 'error',
  26. 'typescript/no-angle-bracket-type-assertion': 'error',
  27. 'typescript/no-empty-interface': 'error',
  28. 'typescript/no-explicit-any': 'error',
  29. 'typescript/no-inferrable-types': 'error',
  30. 'typescript/no-namespace': 'error',
  31. 'typescript/no-non-null-assertion': 'error',
  32. 'typescript/no-triple-slash-reference': 'error',
  33. 'typescript/prefer-namespace-keyword': 'error',
  34. 'typescript/type-annotation-spacing': 'error',
  35. 'no-unused-vars': 'off',
  36. },
  37. settings: {
  38. 'import/resolver': {
  39. node: {
  40. extensions: [
  41. '.js',
  42. '.jsx',
  43. '.android.jsx',
  44. '.android.js',
  45. '.ios.jsx',
  46. '.ios.js',
  47. '.tsx',
  48. '.ts',
  49. '.android.tsx',
  50. '.android.ts',
  51. '.ios.tsx',
  52. '.ios.ts',
  53. ],
  54. },
  55. },
  56. },
  57. };