UNPKG

1.81 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 parserOptions: {
14 ecmaFeatures: {
15 jsx: true,
16 },
17 },
18
19 rules: {
20 // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
21 'react/jsx-equals-spacing': ['warn', 'never'],
22 'react/jsx-handler-names': ['warn', {
23 'eventHandlerPrefix': 'handle',
24 'eventHandlerPropPrefix': 'on'
25 }],
26 'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
27 'react/jsx-no-undef': 'error',
28 'react/jsx-pascal-case': [
29 'warn',
30 {
31 allowAllCaps: true,
32 ignore: [],
33 },
34 ],
35 // Prevent usage of .bind() in JSX props
36 // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
37 'react/jsx-no-bind': ['error', {
38 ignoreRefs: true,
39 allowArrowFunctions: true,
40 allowBind: false,
41 }],
42 'react/jsx-no-comment-textnodes': 'error',
43 'react/jsx-uses-react': 'warn',
44 'react/jsx-uses-vars': 'warn',
45 'react/no-children-prop': 'warn',
46 'react/no-danger-with-children': 'error',
47 'react/no-deprecated': 'error',
48 'react/no-did-mount-set-state': 'warn',
49 'react/no-did-update-set-state': 'warn',
50 'react/no-direct-mutation-state': 'error',
51 'react/no-is-mounted': 'warn',
52 'react/no-string-refs': 'warn',
53 'react/no-unknown-property': 'warn',
54 'react/no-will-update-set-state': 'warn',
55 'react/react-in-jsx-scope': 'error',
56 'react/require-render-return': 'error',
57 'react/sort-comp': 'warn',
58 'react/style-prop-object': 'warn',
59 'react/void-dom-elements-no-children': 'off', // Causes issues with funky structure
60 },
61};
\No newline at end of file