UNPKG

eslint-plugin-sonarjs

Version:
207 lines (206 loc) • 4.42 kB
"use strict"; /* * SonarQube JavaScript Plugin * Copyright (C) SonarSource Sàrl * mailto:info AT sonarsource DOT com * * You can redistribute and/or modify this program under the terms of * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the Sonar Source-Available License for more details. * * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ Object.defineProperty(exports, "__esModule", { value: true }); exports.expectStaticMethods = exports.gettersOrModifiers = exports.assertionFunctions = void 0; exports.assertionFunctions = [ // Chai assertions 'a', 'an', 'include', 'includes', 'contain', 'contains', 'equal', 'equals', 'eq', 'eql', 'eqls', 'above', 'gt', 'greaterThan', 'least', 'gte', 'below', 'lt', 'lessThan', 'most', 'lte', 'within', 'instanceof', 'instanceOf', 'property', 'ownPropertyDescriptor', 'haveOwnPropertyDescriptor', 'lengthOf', 'length', 'match', 'matches', 'string', 'key', 'keys', 'throw', 'throws', 'Throw', 'respondTo', 'respondsTo', 'satisfy', 'satisfies', 'closeTo', 'approximately', 'members', 'oneOf', 'change', 'changes', 'increase', 'increases', 'decrease', 'decreases', 'by', 'fail', // Jest / Vitest / Bun Matchers & Aliases 'toBe', 'toEqual', 'toStrictEqual', 'toBeTruthy', 'toBeFalsy', 'toBeNull', 'toBeUndefined', 'toBeDefined', 'toBeNaN', 'toBeInstanceOf', 'toBeGreaterThan', 'toBeGreaterThanOrEqual', 'toBeLessThan', 'toBeLessThanOrEqual', 'toBeCloseTo', 'toContain', 'toContainEqual', 'toHaveLength', 'toHaveProperty', 'toMatch', 'toMatchObject', 'toHaveBeenCalled', 'toBeCalled', 'toHaveBeenCalledTimes', 'toBeCalledTimes', 'toHaveBeenCalledWith', 'toBeCalledWith', 'toHaveBeenLastCalledWith', 'lastCalledWith', 'toHaveBeenNthCalledWith', 'nthCalledWith', 'toHaveReturned', 'toReturn', 'toHaveReturnedTimes', 'toReturnTimes', 'toHaveReturnedWith', 'toReturnWith', 'toHaveLastReturnedWith', 'lastReturnedWith', 'toHaveNthReturnedWith', 'nthReturnedWith', 'toThrow', 'toThrowError', 'toMatchSnapshot', 'toMatchInlineSnapshot', 'toThrowErrorMatchingSnapshot', 'toThrowErrorMatchingInlineSnapshot', 'toResolve', 'toReject', // @testing-library/jest-dom 'toBeInTheDocument', 'toBeVisible', 'toBeHidden', 'toBeDisabled', 'toBeEnabled', 'toBeRequired', 'toBeInvalid', 'toBeValid', 'toBeEmptyDOMElement', 'toBeChecked', 'toHaveAttribute', 'toHaveClass', 'toHaveStyle', 'toHaveValue', 'toHaveDisplayValue', 'toHaveFocus', 'toHaveTextContent', 'toHaveAccessibleName', 'toHaveAccessibleDescription', 'toHaveAccessibleErrorMessage', 'toHaveErrorMessage', 'toContainElement', 'toContainHTML', // @playwright/test 'toBeAttached', 'toBeEditable', 'toBeInViewport', 'toBeOK', 'toContainText', 'toHaveCSS', 'toHaveId', 'toHaveJSProperty', 'toHaveRole', 'toHaveText', 'toHaveTitle', 'toHaveURL', 'toHaveValues', // Node.js assert methods 'strictEqual', 'notStrictEqual', 'deepStrictEqual', 'notDeepStrictEqual', 'doesNotThrow', 'rejects', 'doesNotReject', 'doesNotMatch', 'ifError', ]; exports.gettersOrModifiers = [ // Chai getters & modifiers 'to', 'be', 'been', 'is', 'that', 'which', 'and', 'has', 'have', 'with', 'at', 'of', 'same', 'but', 'does', 'still', 'deep', 'nested', 'own', 'ordered', 'any', 'all', 'itself', 'should', // Jest / Vitest / Bun modifiers 'not', 'resolves', 'rejects', ]; /** Playwright static methods on `expect` itself (`expect.soft`, `expect.poll`). */ exports.expectStaticMethods = ['soft', 'poll'];