UNPKG

1.85 kBJavaScriptView Raw
1'use strict';
2
3/**
4 * Inspired by create-react-app:
5 * https://github.com/facebookincubator/create-react-app/blob/master/packages/eslint-config-react-app
6 */
7
8module.exports = {
9 plugins: [
10 'react',
11 ],
12
13 ecmaFeatures: {
14 jsx: true,
15 },
16
17 parserOptions: {
18 ecmaFeatures: {
19 jsx: true,
20 },
21 },
22
23 rules: {
24 // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
25 'react/jsx-equals-spacing': ['warn', 'never'],
26 'react/jsx-handler-names': ['warn', {
27 'eventHandlerPrefix': 'handle',
28 'eventHandlerPropPrefix': 'on'
29 }],
30 'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
31 'react/jsx-no-undef': 'error',
32 'react/jsx-pascal-case': [
33 'warn',
34 {
35 allowAllCaps: true,
36 ignore: [],
37 },
38 ],
39 // Prevent usage of .bind() in JSX props
40 // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
41 'react/jsx-no-bind': ['error', {
42 ignoreRefs: true,
43 allowArrowFunctions: true,
44 allowBind: false,
45 }],
46 'react/jsx-no-comment-textnodes': 'error',
47 'react/jsx-uses-react': 'warn',
48 'react/jsx-uses-vars': 'warn',
49 'react/no-children-prop': 'warn',
50 'react/no-danger-with-children': 'error',
51 'react/no-deprecated': 'warn',
52 'react/no-did-mount-set-state': 'warn',
53 'react/no-did-update-set-state': 'warn',
54 'react/no-direct-mutation-state': 'error',
55 'react/no-is-mounted': 'warn',
56 'react/no-string-refs': 'warn',
57 'react/no-unknown-property': 'warn',
58 'react/no-will-update-set-state': 'warn',
59 'react/react-in-jsx-scope': 'error',
60 'react/require-render-return': 'error',
61 'react/sort-comp': 'warn',
62 'react/style-prop-object': 'warn',
63 'react/void-dom-elements-no-children': 'off', // Causes issues with funky structure
64 },
65};
\No newline at end of file