.eslintrc.yml 3.18 KB
Newer Older
Koala Yeung's avatar
Koala Yeung committed
1
---
2 3
root: true

Koala Yeung's avatar
Koala Yeung committed
4 5
env:
  browser: true
6
  node: true
Koala Yeung's avatar
Koala Yeung committed
7
  es6: true
8
  jest: true
Koala Yeung's avatar
Koala Yeung committed
9 10 11 12 13 14

parser: babel-eslint

plugins:
- react
- jsx-a11y
15
- import
16
- promise
Koala Yeung's avatar
Koala Yeung committed
17 18 19 20

parserOptions:
  sourceType: module
  ecmaFeatures:
21
    experimentalObjectRestSpread: true
Koala Yeung's avatar
Koala Yeung committed
22
    jsx: true
23
  ecmaVersion: 2018
Koala Yeung's avatar
Koala Yeung committed
24

25 26 27 28 29 30
settings:
  import/extensions:
  - .js
  import/ignore:
  - node_modules
  - \\.(css|scss|json)$
Koala Yeung's avatar
Koala Yeung committed
31

32
rules:
Koala Yeung's avatar
Koala Yeung committed
33
  brace-style: warn
34 35 36
  comma-dangle:
  - error
  - always-multiline
Koala Yeung's avatar
Koala Yeung committed
37 38 39 40 41 42 43
  comma-spacing:
  - warn
  - before: false
    after: true
  comma-style:
  - warn
  - last
44 45 46 47 48 49 50 51 52 53 54
  consistent-return: error
  dot-notation: error
  eqeqeq: error
  indent:
  - warn
  - 2
  jsx-quotes:
  - error
  - prefer-single
  no-catch-shadow: error
  no-cond-assign: error
55 56 57 58
  no-console:
  - warn
  - allow:
    - error
59
    - warn
60 61
  no-fallthrough: error
  no-irregular-whitespace: error
Koala Yeung's avatar
Koala Yeung committed
62 63 64
  no-mixed-spaces-and-tabs: warn
  no-nested-ternary: warn
  no-trailing-spaces: warn
65
  no-undef: error
66 67
  no-unreachable: error
  no-unused-expressions: error
68 69 70 71 72
  no-unused-vars:
  - error
  - vars: all
    args: after-used
    ignoreRestSiblings: true
73 74 75
  object-curly-spacing:
  - error
  - always
76 77 78
  padded-blocks:
  - error
  - classes: always
79
  quotes:
80
  - error
81 82 83 84
  - single
  semi: error
  strict: off
  valid-typeof: error
Koala Yeung's avatar
Koala Yeung committed
85

86 87 88 89 90 91 92 93 94 95 96 97
  react/jsx-boolean-value: error
  react/jsx-closing-bracket-location:
  - error
  - line-aligned
  react/jsx-curly-spacing: error
  react/jsx-equals-spacing: error
  react/jsx-first-prop-new-line:
  - error
  - multiline-multiprop
  react/jsx-indent:
  - error
  - 2
Sorin Davidoi's avatar
Sorin Davidoi committed
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 103
  react/jsx-uses-react: error
  react/jsx-uses-vars: error
104
  react/jsx-wrap-multilines: error
Koala Yeung's avatar
Koala Yeung committed
105
  react/no-multi-comp: off
106
  react/no-string-refs: error
107 108
  react/prop-types: error
  react/self-closing-comp: error
Koala Yeung's avatar
Koala Yeung committed
109 110

  jsx-a11y/accessible-emoji: warn
111
  jsx-a11y/alt-text: warn
Koala Yeung's avatar
Koala Yeung committed
112 113 114 115 116 117 118 119 120 121 122
  jsx-a11y/anchor-has-content: warn
  jsx-a11y/aria-activedescendant-has-tabindex: warn
  jsx-a11y/aria-props: warn
  jsx-a11y/aria-proptypes: warn
  jsx-a11y/aria-role: warn
  jsx-a11y/aria-unsupported-elements: warn
  jsx-a11y/heading-has-content: warn
  jsx-a11y/href-no-hash: warn
  jsx-a11y/html-has-lang: warn
  jsx-a11y/iframe-has-title: warn
  jsx-a11y/img-redundant-alt: warn
123
  jsx-a11y/interactive-supports-focus: warn
124
  jsx-a11y/label-has-for: off
Koala Yeung's avatar
Koala Yeung committed
125 126 127
  jsx-a11y/mouse-events-have-key-events: warn
  jsx-a11y/no-access-key: warn
  jsx-a11y/no-distracting-elements: warn
128 129 130 131
  jsx-a11y/no-noninteractive-element-interactions:
  - warn
  - handlers:
    - onClick
Koala Yeung's avatar
Koala Yeung committed
132 133
  jsx-a11y/no-onchange: warn
  jsx-a11y/no-redundant-roles: warn
134 135 136 137
  jsx-a11y/no-static-element-interactions:
  - warn
  - handlers:
    - onClick
Koala Yeung's avatar
Koala Yeung committed
138
  jsx-a11y/role-has-required-aria-props: warn
139
  jsx-a11y/role-supports-aria-props: off
Koala Yeung's avatar
Koala Yeung committed
140 141
  jsx-a11y/scope: warn
  jsx-a11y/tabindex-no-positive: warn
142 143 144 145 146 147 148 149 150 151 152 153 154 155

  import/extensions:
  - error
  - always
  - js: never
  import/newline-after-import: error
  import/no-extraneous-dependencies:
  - error
  - devDependencies:
    - "config/webpack/**"
    - "app/javascript/mastodon/test_setup.js"
    - "app/javascript/**/__tests__/**"
  import/no-unresolved: error
  import/no-webpack-loader-syntax: error
156 157

  promise/catch-or-return: error