|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.default = void 0;
|
|---|
| 7 |
|
|---|
| 8 | var _utils = require("./utils");
|
|---|
| 9 |
|
|---|
| 10 | var _default = (0, _utils.createRule)({
|
|---|
| 11 | name: __filename,
|
|---|
| 12 | meta: {
|
|---|
| 13 | docs: {
|
|---|
| 14 | category: 'Best Practices',
|
|---|
| 15 | description: 'Disallow setup and teardown hooks',
|
|---|
| 16 | recommended: false
|
|---|
| 17 | },
|
|---|
| 18 | messages: {
|
|---|
| 19 | unexpectedHook: "Unexpected '{{ hookName }}' hook"
|
|---|
| 20 | },
|
|---|
| 21 | schema: [{
|
|---|
| 22 | type: 'object',
|
|---|
| 23 | properties: {
|
|---|
| 24 | allow: {
|
|---|
| 25 | type: 'array',
|
|---|
| 26 | contains: ['beforeAll', 'beforeEach', 'afterAll', 'afterEach']
|
|---|
| 27 | }
|
|---|
| 28 | },
|
|---|
| 29 | additionalProperties: false
|
|---|
| 30 | }],
|
|---|
| 31 | type: 'suggestion'
|
|---|
| 32 | },
|
|---|
| 33 | defaultOptions: [{
|
|---|
| 34 | allow: []
|
|---|
| 35 | }],
|
|---|
| 36 |
|
|---|
| 37 | create(context, [{
|
|---|
| 38 | allow = []
|
|---|
| 39 | }]) {
|
|---|
| 40 | return {
|
|---|
| 41 | CallExpression(node) {
|
|---|
| 42 | if ((0, _utils.isHook)(node) && !allow.includes(node.callee.name)) {
|
|---|
| 43 | context.report({
|
|---|
| 44 | node,
|
|---|
| 45 | messageId: 'unexpectedHook',
|
|---|
| 46 | data: {
|
|---|
| 47 | hookName: node.callee.name
|
|---|
| 48 | }
|
|---|
| 49 | });
|
|---|
| 50 | }
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | };
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 | });
|
|---|
| 57 |
|
|---|
| 58 | exports.default = _default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.