.eslintrc 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {
  2. // ╔═╗╔═╗╦ ╦╔╗╔╔╦╗┬─┐┌─┐
  3. // ║╣ ╚═╗║ ║║║║ ║ ├┬┘│
  4. // o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘
  5. // A set of basic conventions (similar to .jshintrc) for use within any
  6. // arbitrary JavaScript / Node.js package -- inside or outside Sails.js.
  7. // For the master copy of this file, see the `.eslintrc` template file in
  8. // the `sails-generate` package (https://www.npmjs.com/package/sails-generate.)
  9. // Designed for ESLint v4.
  10. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11. // For more information about any of the rules below, check out the relevant
  12. // reference page on eslint.org. For example, to get details on "no-sequences",
  13. // you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure
  14. // or could use some advice, come by https://sailsjs.com/support.
  15. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  16. "env": {
  17. "node": true
  18. },
  19. "parserOptions": {
  20. "ecmaVersion": 5
  21. // ^^This can be changed to `8` if this package doesn't need to support <= Node v6.
  22. },
  23. "globals": {
  24. "Promise": true
  25. // ^^Available since Node v4
  26. },
  27. "rules": {
  28. "callback-return": ["error", ["done", "proceed", "next", "onwards", "callback", "cb"]],
  29. "camelcase": ["warn", {"properties": "always"}],
  30. "comma-style": ["warn", "last"],
  31. "curly": ["error"],
  32. "eqeqeq": ["error", "always"],
  33. "eol-last": ["warn"],
  34. "handle-callback-err": ["error"],
  35. "indent": ["warn", 2, {
  36. "SwitchCase": 1,
  37. "MemberExpression": "off",
  38. "FunctionDeclaration": {"body":1, "parameters": "off"},
  39. "FunctionExpression": {"body":1, "parameters": "off"},
  40. "CallExpression": {"arguments":"off"},
  41. "ArrayExpression": 1,
  42. "ObjectExpression": 1,
  43. "ignoredNodes": ["ConditionalExpression"]
  44. }],
  45. "linebreak-style": ["error", "unix"],
  46. "no-dupe-keys": ["error"],
  47. "no-duplicate-case": ["error"],
  48. "no-extra-semi": ["warn"],
  49. "no-labels": ["error"],
  50. "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
  51. "no-redeclare": ["warn"],
  52. "no-return-assign": ["error", "always"],
  53. "no-sequences": ["error"],
  54. "no-trailing-spaces": ["warn"],
  55. "no-undef": ["error"],
  56. "no-unexpected-multiline": ["warn"],
  57. "no-unreachable": ["warn"],
  58. "no-unused-vars": ["warn", {"caughtErrors":"all", "caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)", "argsIgnorePattern": "^unused($|[A-Z].*$)", "varsIgnorePattern": "^unused($|[A-Z].*$)" }],
  59. "no-use-before-define": ["error", {"functions":false}],
  60. "one-var": ["warn", "never"],
  61. "quotes": ["warn", "single", {"avoidEscape":false, "allowTemplateLiterals":true}],
  62. "semi": ["error", "always"],
  63. "semi-spacing": ["warn", {"before":false, "after":true}],
  64. "semi-style": ["warn", "last"]
  65. }
  66. }