.eslintrc.yml 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ---
  2. root: true
  3. env:
  4. browser: true
  5. node: true
  6. es6: true
  7. jest: true
  8. globals:
  9. ATTACHMENT_HOST: false
  10. parser: babel-eslint
  11. plugins:
  12. - react
  13. - jsx-a11y
  14. - import
  15. - promise
  16. parserOptions:
  17. sourceType: module
  18. ecmaFeatures:
  19. experimentalObjectRestSpread: true
  20. jsx: true
  21. ecmaVersion: 2018
  22. settings:
  23. import/extensions:
  24. - .js
  25. import/ignore:
  26. - node_modules
  27. - \\.(css|scss|json)$
  28. import/resolver:
  29. node:
  30. moduleDirectory:
  31. - node_modules
  32. - app/javascript
  33. rules:
  34. brace-style: warn
  35. comma-dangle:
  36. - error
  37. - always-multiline
  38. comma-spacing:
  39. - warn
  40. - before: false
  41. after: true
  42. comma-style:
  43. - warn
  44. - last
  45. consistent-return: error
  46. dot-notation: error
  47. eqeqeq: error
  48. indent:
  49. - warn
  50. - 2
  51. jsx-quotes:
  52. - error
  53. - prefer-single
  54. no-catch-shadow: error
  55. no-cond-assign: error
  56. no-console:
  57. - warn
  58. - allow:
  59. - error
  60. - warn
  61. no-fallthrough: error
  62. no-irregular-whitespace: error
  63. no-mixed-spaces-and-tabs: warn
  64. no-nested-ternary: warn
  65. no-trailing-spaces: warn
  66. no-undef: error
  67. no-unreachable: error
  68. no-unused-expressions: error
  69. no-unused-vars:
  70. - error
  71. - vars: all
  72. args: after-used
  73. ignoreRestSiblings: true
  74. object-curly-spacing:
  75. - error
  76. - always
  77. padded-blocks:
  78. - error
  79. - classes: always
  80. quotes:
  81. - error
  82. - single
  83. semi: error
  84. strict: off
  85. valid-typeof: error
  86. react/jsx-boolean-value: error
  87. react/jsx-closing-bracket-location:
  88. - error
  89. - line-aligned
  90. react/jsx-curly-spacing: error
  91. react/jsx-equals-spacing: error
  92. react/jsx-first-prop-new-line:
  93. - error
  94. - multiline-multiprop
  95. react/jsx-indent:
  96. - error
  97. - 2
  98. react/jsx-no-bind: error
  99. react/jsx-no-duplicate-props: error
  100. react/jsx-no-undef: error
  101. react/jsx-tag-spacing: error
  102. react/jsx-uses-react: error
  103. react/jsx-uses-vars: error
  104. react/jsx-wrap-multilines: error
  105. react/no-multi-comp: off
  106. react/no-string-refs: error
  107. react/prop-types: error
  108. react/self-closing-comp: error
  109. jsx-a11y/accessible-emoji: warn
  110. jsx-a11y/alt-text: warn
  111. jsx-a11y/anchor-has-content: warn
  112. jsx-a11y/anchor-is-valid:
  113. - warn
  114. - components:
  115. - Link
  116. - NavLink
  117. specialLink:
  118. - to
  119. aspect:
  120. - noHref
  121. - invalidHref
  122. - preferButton
  123. jsx-a11y/aria-activedescendant-has-tabindex: warn
  124. jsx-a11y/aria-props: warn
  125. jsx-a11y/aria-proptypes: warn
  126. jsx-a11y/aria-role: warn
  127. jsx-a11y/aria-unsupported-elements: warn
  128. jsx-a11y/heading-has-content: warn
  129. jsx-a11y/html-has-lang: warn
  130. jsx-a11y/iframe-has-title: warn
  131. jsx-a11y/img-redundant-alt: warn
  132. jsx-a11y/interactive-supports-focus: warn
  133. jsx-a11y/label-has-for: off
  134. jsx-a11y/mouse-events-have-key-events: warn
  135. jsx-a11y/no-access-key: warn
  136. jsx-a11y/no-distracting-elements: warn
  137. jsx-a11y/no-noninteractive-element-interactions:
  138. - warn
  139. - handlers:
  140. - onClick
  141. jsx-a11y/no-onchange: warn
  142. jsx-a11y/no-redundant-roles: warn
  143. jsx-a11y/no-static-element-interactions:
  144. - warn
  145. - handlers:
  146. - onClick
  147. jsx-a11y/role-has-required-aria-props: warn
  148. jsx-a11y/role-supports-aria-props: off
  149. jsx-a11y/scope: warn
  150. jsx-a11y/tabindex-no-positive: warn
  151. import/extensions:
  152. - error
  153. - always
  154. - js: never
  155. import/newline-after-import: error
  156. import/no-extraneous-dependencies:
  157. - error
  158. - devDependencies:
  159. - "config/webpack/**"
  160. - "app/javascript/mastodon/test_setup.js"
  161. - "app/javascript/**/__tests__/**"
  162. import/no-unresolved: error
  163. import/no-webpack-loader-syntax: error
  164. promise/catch-or-return: error