.eslintrc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {
  2. "extends": "eslint-config-airbnb",
  3. "rules": {
  4. // errors
  5. "arrow-parens": 2,
  6. "arrow-spacing": 2,
  7. "id-length": 0,
  8. "indent": [2, "tab"],
  9. "linebreak-style": [2, "unix"],
  10. "new-cap": [2, {
  11. "capIsNew": false
  12. }],
  13. "no-dupe-class-members": 2,
  14. "no-magic-numbers": 2,
  15. "no-octal": 0,
  16. "no-octal-escape": 0,
  17. "no-shadow": 0,
  18. "no-undef": 2,
  19. "no-useless-concat": 2,
  20. "no-use-before-define": [2, "nofunc"],
  21. "object-curly-spacing": [2, "always"],
  22. "prefer-template": 2,
  23. "space-before-function-paren": [2, {
  24. "anonymous": "always",
  25. "named": "never"
  26. }],
  27. "space-in-parens": [2, "never"],
  28. // warnings
  29. "brace-style": [1, "stroustrup"],
  30. "padded-blocks": [1, "never"],
  31. "quotes": [1, "double", "avoid-escape"],
  32. "block-scoped-var": 0,
  33. "no-var": 0,
  34. "vars-on-top": 0,
  35. "func-names": 0,
  36. "comma-dangle": 0,
  37. "react/react-in-jsx-scope": 0,
  38. "react/no-multi-comp": 0,
  39. "react/prop-types": [2, {
  40. "ignore": ["className", "children", "flux"]
  41. }],
  42. // React
  43. "react/sort-comp": [2, {
  44. "order": [
  45. "lifecycle",
  46. "/^on.+$/",
  47. "render",
  48. "everything-else"
  49. ],
  50. "groups": {
  51. "lifecycle": [
  52. "displayName",
  53. "propTypes",
  54. "contextTypes",
  55. "childContextTypes",
  56. "defaultProps",
  57. "state",
  58. "constructor",
  59. "getDefaultProps",
  60. "getInitialState",
  61. "getChildContext",
  62. "componentWillMount",
  63. "componentDidMount",
  64. "componentWillReceiveProps",
  65. "shouldComponentUpdate",
  66. "componentWillUpdate",
  67. "componentDidUpdate",
  68. "componentWillUnmount"
  69. ]
  70. }
  71. }]
  72. },
  73. "stage": 0,
  74. "plugins": [
  75. "react"
  76. ],
  77. "ecmaFeatures": {
  78. "jsx": true
  79. },
  80. "env": {
  81. "es6": true
  82. }
  83. }