Keine Beschreibung

.eslintrc.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 JS & TS files
  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. // Restrict imports that should be used carefully. Usually we have created a wrapper around them
  25. 'typescript/adjacent-overload-signatures': 'error',
  26. 'typescript/explicit-function-return-type': '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. 'no-unused-vars': 'off',
  37. },
  38. settings: {
  39. 'import/resolver': {
  40. node: {
  41. extensions: [
  42. '.js',
  43. '.jsx',
  44. '.android.jsx',
  45. '.android.js',
  46. '.ios.jsx',
  47. '.ios.js',
  48. '.tsx',
  49. '.ts',
  50. '.android.tsx',
  51. '.android.ts',
  52. '.ios.tsx',
  53. '.ios.ts',
  54. ],
  55. },
  56. },
  57. },
  58. };