{ "parserOptions": { "ecmaFeatures": { "jsx": true, }, }, "plugins": [ "react", "jsx-a11y", ], "settings": { "react": { "version": "14.0", }, }, "rules": { "class-methods-use-this": [ "error", { "exceptMethods": [ "componentDidMount", "componentDidUpdate", "componentWillMount", "componentWillReceiveProps", "componentWillUnmount", "componentWillUpdate", "render", "shouldComponentUpdate", ], }, ], "react/display-name": "error", "react/no-children-prop": "error", "react/no-danger-with-children": "error", "react/no-deprecated": "error", "react/no-did-mount-set-state": "error", "react/no-did-update-set-state": "error", "react/no-direct-mutation-state": "error", "react/no-is-mounted": "error", "no-inner-declarations": "error", // Allow to have more than one component per file, left at the discretion of // the developer. "react/no-multi-comp": "off", "react/no-render-return-value": "error", "react/no-string-refs": "error", "react/no-unknown-property": "error", "react/no-unescaped-entities": "error", "react/no-unused-prop-types": "error", "react/prefer-es6-class": "error", "react/prefer-stateless-function": "error", "react/prop-types": "error", "react/react-in-jsx-scope": "error", "react/require-default-props": "error", "react/require-optimization": "warn", "react/require-render-return": "error", "react/self-closing-comp": "error", "react/sort-comp": [ "error", { "order": [ "type-annotations", "static-methods", "definition", "lifecycle", "/^handle.+$/", "/^on.+$/", "everything-else", "rendering", ], "groups": { "definition": [ "displayName", "propTypes", "contextTypes", "childContextTypes", "mixins", "statics", "defaultProps", "state", "constructor", ], "lifecycle": [ "getDefaultProps", "getInitialState", "getChildContext", "componentWillMount", "componentDidMount", "componentWillReceiveProps", "shouldComponentUpdate", "componentWillUpdate", "componentDidUpdate", "componentWillUnmount", ], "rendering": [ "/^render.+$/", "render", ], }, }, ], "react/sort-prop-types": [ "error", { "callbacksLast": true, "ignoreCase": true, }, ], "react/style-prop-object": "error", /* * JSX-centric rules. */ "react/jsx-boolean-value": "error", "react/jsx-closing-bracket-location": "error", "react/jsx-curly-spacing": "error", "react/jsx-equals-spacing": "error", "react/jsx-filename-extension": [ "error", {"extensions": [".jsx"]}, ], "react/jsx-first-prop-new-line": "error", "react/jsx-handler-names": [ "error", { "eventHandlerPrefix": "handle", "eventHandlerPropPrefix": "on", }, ], "react/jsx-indent": [ "error", 2, ], "react/jsx-indent-props": [ "error", 2, ], "react/jsx-key": "error", "react/jsx-no-bind": [ "error", {"ignoreRefs": true}, ], "react/jsx-no-comment-textnodes": "error", "react/jsx-no-duplicate-props": "error", "react/jsx-no-target-blank": "error", "react/jsx-no-undef": "error", "react/jsx-pascal-case": "error", "react/jsx-sort-props": [ "error", { "callbacksLast": true, "shorthandLast": true, "ignoreCase": false, }, ], "react/jsx-space-before-closing": "error", "react/jsx-tag-spacing": "error", "react/jsx-uses-react": "error", "react/jsx-uses-vars": "error", "react/jsx-wrap-multilines": "error", // Allow nested ternary operators for JSX components. "no-nested-ternary": "off", /* * Accessibility rules. */ "jsx-a11y/anchor-has-content": "error", "jsx-a11y/aria-props": "error", "jsx-a11y/aria-proptypes": "error", "jsx-a11y/aria-role": "error", "jsx-a11y/aria-unsupported-elements": "error", "jsx-a11y/click-events-have-key-events": "error", "jsx-a11y/heading-has-content": "error", "jsx-a11y/href-no-hash": "error", "jsx-a11y/html-has-lang": "error", "jsx-a11y/img-has-alt": "error", "jsx-a11y/label-has-for": "error", "jsx-a11y/lang": "error", "jsx-a11y/mouse-events-have-key-events": "error", "jsx-a11y/no-access-key": "error", "jsx-a11y/no-marquee": "error", "jsx-a11y/no-onchange": "error", "jsx-a11y/no-static-element-interactions": "error", "jsx-a11y/onclick-has-focus": "error", "jsx-a11y/onclick-has-role": "error", "jsx-a11y/role-has-required-aria-props": "error", "jsx-a11y/role-supports-aria-props": "error", "jsx-a11y/scope": "error", "jsx-a11y/tabindex-no-positive": "error", }, }