variables.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. 'use strict';
  2. module.exports = {
  3. rules: {
  4. /**
  5. * Doesn't enforce variable initializations
  6. * @see http://eslint.org/docs/rules/init-declarations
  7. */
  8. 'init-declarations': 'off',
  9. /**
  10. * allow the catch clause parameter name being the same as a variable in the outer scope
  11. * @see http://eslint.org/docs/rules/no-catch-shadow
  12. * @since 3.0.0
  13. */
  14. 'no-catch-shadow': 'off',
  15. /**
  16. * disallow deletion of variables
  17. * @see http://eslint.org/docs/rules/no-delete-var
  18. */
  19. 'no-delete-var': 'error',
  20. /**
  21. * disallow labels that share a name with a variable
  22. * @see http://eslint.org/docs/rules/no-label-var
  23. */
  24. 'no-label-var': 'error',
  25. /**
  26. * disallow specific globals
  27. * @see http://eslint.org/docs/rules/no-restricted-globals
  28. * @since 3.0.0
  29. */
  30. 'no-restricted-globals': 'off',
  31. /**
  32. * allow declaration of variables already declared in the outer scope
  33. * @see http://eslint.org/docs/rules/no-shadow
  34. */
  35. 'no-shadow': 'off',
  36. /**
  37. * disallow shadowing of names such as arguments
  38. * @see http://eslint.org/docs/rules/no-shadow-restricted-names
  39. */
  40. 'no-shadow-restricted-names': 'error',
  41. /**
  42. * disallow use of undeclared variables unless mentioned in a `global` block
  43. * @see http://eslint.org/docs/rules/no-undef
  44. */
  45. 'no-undef': 'error',
  46. /**
  47. * disallow use of undefined when initializing variables
  48. * @see http://eslint.org/docs/rules/no-undef-init
  49. */
  50. 'no-undef-init': 'error',
  51. /**
  52. * disallow use of undefined variable
  53. * @see http://eslint.org/docs/rules/no-undefined
  54. */
  55. 'no-undefined': 'off',
  56. /**
  57. * disallow declaration of variables that are not used in the code
  58. * @see http://eslint.org/docs/rules/no-unused-vars
  59. * @since 3.0.0
  60. */
  61. 'no-unused-vars': [ 'error', { vars: 'local', args: 'after-used' }],
  62. /**
  63. * disallow use of variables before they are defined
  64. * @see http://eslint.org/docs/rules/no-use-before-define
  65. */
  66. 'no-use-before-define': [ 'error', 'nofunc' ],
  67. /**
  68. * require let or const instead of var
  69. * @see http://eslint.org/docs/rules/no-var
  70. */
  71. 'no-var': 'off',
  72. },
  73. };