Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

no-hooks.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _utils = require("./utils");
  7. var _default = (0, _utils.createRule)({
  8. name: __filename,
  9. meta: {
  10. docs: {
  11. category: 'Best Practices',
  12. description: 'Disallow setup and teardown hooks',
  13. recommended: false
  14. },
  15. messages: {
  16. unexpectedHook: "Unexpected '{{ hookName }}' hook"
  17. },
  18. schema: [{
  19. type: 'object',
  20. properties: {
  21. allow: {
  22. type: 'array',
  23. contains: ['beforeAll', 'beforeEach', 'afterAll', 'afterEach']
  24. }
  25. },
  26. additionalProperties: false
  27. }],
  28. type: 'suggestion'
  29. },
  30. defaultOptions: [{
  31. allow: []
  32. }],
  33. create(context, [{
  34. allow = []
  35. }]) {
  36. return {
  37. CallExpression(node) {
  38. if ((0, _utils.isHook)(node) && !allow.includes(node.callee.name)) {
  39. context.report({
  40. node,
  41. messageId: 'unexpectedHook',
  42. data: {
  43. hookName: node.callee.name
  44. }
  45. });
  46. }
  47. }
  48. };
  49. }
  50. });
  51. exports.default = _default;