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