|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.3 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: 'Suggest using `toStrictEqual()`',
|
|---|
| 16 | recommended: false,
|
|---|
| 17 | suggestion: true
|
|---|
| 18 | },
|
|---|
| 19 | messages: {
|
|---|
| 20 | useToStrictEqual: 'Use `toStrictEqual()` instead',
|
|---|
| 21 | suggestReplaceWithStrictEqual: 'Replace with `toStrictEqual()`'
|
|---|
| 22 | },
|
|---|
| 23 | type: 'suggestion',
|
|---|
| 24 | schema: [],
|
|---|
| 25 | hasSuggestions: true
|
|---|
| 26 | },
|
|---|
| 27 | defaultOptions: [],
|
|---|
| 28 |
|
|---|
| 29 | create(context) {
|
|---|
| 30 | return {
|
|---|
| 31 | CallExpression(node) {
|
|---|
| 32 | if (!(0, _utils.isExpectCall)(node)) {
|
|---|
| 33 | return;
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | const {
|
|---|
| 37 | matcher
|
|---|
| 38 | } = (0, _utils.parseExpectCall)(node);
|
|---|
| 39 |
|
|---|
| 40 | if (matcher && (0, _utils.isParsedEqualityMatcherCall)(matcher, _utils.EqualityMatcher.toEqual)) {
|
|---|
| 41 | context.report({
|
|---|
| 42 | messageId: 'useToStrictEqual',
|
|---|
| 43 | node: matcher.node.property,
|
|---|
| 44 | suggest: [{
|
|---|
| 45 | messageId: 'suggestReplaceWithStrictEqual',
|
|---|
| 46 | fix: fixer => [fixer.replaceText(matcher.node.property, _utils.EqualityMatcher.toStrictEqual)]
|
|---|
| 47 | }]
|
|---|
| 48 | });
|
|---|
| 49 | }
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | };
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | });
|
|---|
| 56 |
|
|---|
| 57 | exports.default = _default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.