.eslintrc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {
  2. "parser": "babel-eslint",
  3. "plugins": [
  4. "flowtype",
  5. "transform-runtime-aliasing"
  6. ],
  7. "extends": [
  8. "eslint:recommended",
  9. "plugin:flowtype/recommended"
  10. ],
  11. "rules": {
  12. "arrow-spacing": 2,
  13. "brace-style": [2, "1tbs", { "allowSingleLine": true }],
  14. // We'd possibly like to remove the 'properties': 'never' one day.
  15. "camelcase": [2, { "properties": "never" }],
  16. "comma-dangle": [2, "always-multiline"],
  17. "comma-spacing": [2, { "before": false, "after": true }],
  18. "constructor-super": 2,
  19. "curly": 2,
  20. "eol-last": 2,
  21. "eqeqeq": [2, "allow-null"],
  22. "guard-for-in": 2,
  23. "indent": "off",
  24. "indent-legacy": [2, 4, {"SwitchCase": 1}],
  25. "keyword-spacing": 2,
  26. "linebreak-style": [2, "unix"],
  27. "max-len": [2, 84, 4, { "ignoreUrls": true, "ignorePattern": "\\brequire\\([\"']|eslint-disable" }],
  28. "new-cap": 2,
  29. "no-alert": 2,
  30. "no-array-constructor": 2,
  31. "no-console": 2,
  32. "no-const-assign": 2,
  33. "no-debugger": 2,
  34. "no-dupe-class-members": 2,
  35. "no-dupe-keys": 2,
  36. "no-extra-bind": 2,
  37. "no-new": 2,
  38. "no-new-func": 2,
  39. "no-new-object": 2,
  40. "no-spaced-func": 2,
  41. "no-this-before-super": 2,
  42. "no-throw-literal": 2,
  43. "no-trailing-spaces": 2,
  44. "no-undef": 2,
  45. "no-unexpected-multiline": 2,
  46. "no-unreachable": 2,
  47. "no-unused-vars": [2, {"args": "none", "varsIgnorePattern": "^_*$"}],
  48. "no-useless-call": 2,
  49. "no-var": 2,
  50. "no-with": 2,
  51. "object-curly-spacing": [2, "never"],
  52. "one-var": [2, "never"],
  53. "prefer-const": 2,
  54. "prefer-spread": 0, // re-enable once we use es6
  55. "semi": [2, "always"],
  56. "space-before-blocks": 2,
  57. "space-before-function-paren": [2, "never"],
  58. "space-infix-ops": 2,
  59. "space-unary-ops": 2,
  60. // ---------------------------------------
  61. // Stuff we explicitly disable.
  62. // We turned this off because it complains when you have a
  63. // multi-line string, which I think is going too far.
  64. "prefer-template": 0,
  65. // We've decided explicitly not to care about this.
  66. "arrow-parens": 0,
  67. // ---------------------------------------
  68. // TODO(csilvers): enable these if/when community agrees on it.
  69. "prefer-arrow-callback": 0,
  70. // Might be nice to turn this on one day, but since we don't
  71. // use jsdoc anywhere it seems silly to require it yet.
  72. "valid-jsdoc": 0,
  73. "require-jsdoc": 0
  74. },
  75. "env": {
  76. "es6": true,
  77. "node": true,
  78. "browser": true
  79. },
  80. "overrides": [{
  81. "files": ["katex.js", "src/**/*.js", "contrib/**/*.js"],
  82. "excludedFiles": ["*-spec.js", "unicodeMake.js"],
  83. "rules": {
  84. "no-restricted-syntax": [2, "ForOfStatement", "ClassDeclaration[superClass]", "ClassExpression[superClass]"],
  85. "transform-runtime-aliasing/no-transform-runtime-aliasing": [2, {
  86. "transformEnabled": false,
  87. "ignore": ["parseInt", "parseFloat", "JSON.stringify"]
  88. }]
  89. },
  90. "env": {
  91. "node": false
  92. }
  93. }],
  94. "root": true
  95. }