Brak opisu

.eslintrc.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. 'no-unused-vars': 'error',
  25. 'typescript/no-unused-vars': 'error',
  26. 'typescript/adjacent-overload-signatures': 'error',
  27. 'typescript/no-angle-bracket-type-assertion': 'error',
  28. 'typescript/no-empty-interface': 'error',
  29. 'typescript/no-explicit-any': 'error',
  30. 'typescript/no-inferrable-types': 'error',
  31. 'typescript/no-namespace': 'error',
  32. 'typescript/no-non-null-assertion': 'error',
  33. 'typescript/no-triple-slash-reference': 'error',
  34. 'typescript/prefer-namespace-keyword': 'error',
  35. 'typescript/type-annotation-spacing': 'error',
  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. };