.eslintrc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {
  2. "root": true,
  3. "extends": "@ljharb",
  4. "ignorePatterns": [
  5. "Gruntfile.js",
  6. "*.min.js",
  7. ],
  8. "rules": {
  9. "array-bracket-newline": [0],
  10. "array-element-newline": [0],
  11. "callback-return": [0],
  12. "complexity": [1],
  13. "consistent-return": [1],
  14. "eqeqeq": [2, "allow-null"],
  15. "func-name-matching": [0],
  16. "global-require": [0],
  17. "id-length": [2, { "min": 1, "max": 40 }],
  18. "indent": [2, 2],
  19. "max-depth": [2, 5],
  20. "max-len": 0,
  21. "max-lines": [1],
  22. "max-lines-per-function": [0],
  23. "max-params": [2, 4],
  24. "max-statements": [1, 25],
  25. "max-statements-per-line": [2, { "max": 2 }],
  26. "multiline-comment-style": [0],
  27. "new-cap": [2, { "capIsNewExceptions": ["Call", "Construct", "CreateHTML", "GetIterator", "GetMethod", "IsCallable", "IsConstructor", "IsPromise", "IsRegExp", "IteratorClose", "IteratorComplete", "IteratorNext", "IteratorStep", "Map", "OrigNumber", "RequireObjectCoercible", "SameValue", "SameValueZero", "Set", "SpeciesConstructor", "ToInteger", "ToLength", "ToNumber", "ToObject", "ToString", "ToUint32", "TypeIsObject"] }],
  28. "no-constant-condition": [1],
  29. "no-extend-native": [2, { "exceptions": ["Set"] }],
  30. "no-extra-parens": 0,
  31. "no-implicit-coercion": [2, {
  32. "boolean": false,
  33. "number": false,
  34. "string": true
  35. }],
  36. "no-invalid-this": [0],
  37. "no-loss-of-precision": [1],
  38. "no-native-reassign": [2, { "exceptions": ["Number", "Promise", "RegExp"] }],
  39. "no-negated-condition": [1],
  40. "no-param-reassign": [1],
  41. "no-plusplus": [1],
  42. "no-restricted-syntax": [2, "DebuggerStatement", "LabeledStatement", "WithStatement"],
  43. "no-shadow": [1],
  44. "no-underscore-dangle": [0],
  45. "no-unused-vars": [1, { "vars": "all", "args": "after-used" }],
  46. "no-use-before-define": [1],
  47. "no-useless-call": [0],
  48. "object-curly-newline": [1],
  49. "sort-keys": [0],
  50. "spaced-comment": [0],
  51. "strict": [0]
  52. },
  53. "overrides": [
  54. {
  55. "files": "test/**",
  56. "env": {
  57. "browser": true,
  58. "mocha": true,
  59. },
  60. "globals": {
  61. "assert": false,
  62. "expect": false,
  63. "chai": false,
  64. },
  65. "rules": {
  66. "array-callback-return": 0,
  67. "func-name-matching": 0,
  68. "max-lines-per-function": 0,
  69. "max-statements-per-line": [2, { "max": 2 }],
  70. "no-restricted-properties": 1,
  71. "symbol-description": 0,
  72. "prefer-promise-reject-errors": 0,
  73. "consistent-return": 0,
  74. },
  75. },
  76. {
  77. "files": "test-sham/**",
  78. "env": {
  79. "mocha": true,
  80. },
  81. "globals": {
  82. "expect": false,
  83. },
  84. "rules": {
  85. "max-nested-callbacks": [2, 5],
  86. },
  87. }
  88. ]
  89. }