Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): remove eslint-plugin-jest #4846

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import jest from 'eslint-plugin-jest';
import lwcInternal from '@lwc/eslint-plugin-lwc-internal';
import _import from 'eslint-plugin-import';
import header from 'eslint-plugin-header';
Expand Down Expand Up @@ -37,7 +36,6 @@ export default tseslint.config(
'@lwc/lwc-internal': lwcInternal,
import: _import,
header,
vitest,
},

linterOptions: {
Expand Down Expand Up @@ -224,7 +222,7 @@ export default tseslint.config(
},
},
{
files: ['**/__tests__/**', '**/__mocks__/**', 'packages/@lwc/integration-karma/**'],
files: ['packages/@lwc/integration-karma/**'],
cardoso marked this conversation as resolved.
Show resolved Hide resolved

languageOptions: {
globals: {
Expand All @@ -234,27 +232,24 @@ export default tseslint.config(
},

plugins: {
jest,
vitest,
cardoso marked this conversation as resolved.
Show resolved Hide resolved
},

rules: {
'jest/no-focused-tests': 'error',
'jest/valid-expect': 'error',
'jest/valid-expect-in-promise': 'error',
'vitest/no-focused-tests': 'error',
'vitest/valid-expect': 'error',
'vitest/valid-expect-in-promise': 'error',
'vitest/no-conditional-tests': 'error',
'vitest/no-done-callback': 'error',
},
},
{
files: ['**/__tests__/**'],
ignores: ['packages/@lwc/integration-karma/**'],
rules: {
...vitest.configs.recommended.rules,
plugins: {
vitest,
},
},
{
files: ['packages/@lwc/integration-karma/**'],
rules: {
'vitest/no-conditional-tests': 'error',
'vitest/no-done-callback': 'error',
...vitest.configs.recommended.rules,
},
},
{
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@types/babel__core": "^7.20.5",
"@types/node": "^22.9.0",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/eslint-plugin": "^1.1.8",
"@vitest/eslint-plugin": "^1.1.10",
"@vitest/ui": "^2.1.4",
"@vitest/utils": "^2.1.2",
"bytes": "^3.1.2",
Expand All @@ -58,7 +58,6 @@
"eslint-config-flat-gitignore": "^0.3.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
"glob": "^11.0.0",
"globals": "^15.12.0",
"husky": "^9.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
];

function expectWarningForNonStandardPropertyAccess(callback) {
// eslint-disable-next-line jest/valid-expect
// eslint-disable-next-line vitest/valid-expect
let expected = expect(callback);
if (!usePropertyAccess) {
expected = expected.not;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('restrictions', () => {
it('should throw on setting outerHTML', () => {
// Using two expect()s because one looks for errors, the other looks for logs
expect(() => {
// eslint-disable-next-line jest/valid-expect
// eslint-disable-next-line vitest/valid-expect
let expected = expect(() => {
elm.shadowRoot.querySelector('div').outerHTML = '';
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function testAriaProperty(property, attribute, suite = describe) {
}

function expectWarningIfNonStandard(callback) {
// eslint-disable-next-line jest/valid-expect
// eslint-disable-next-line vitest/valid-expect
let expected = expect(callback);
if (!nonStandardAriaProperties.includes(property)) {
expected = expected.not;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Element.innerHTML - set', () => {

const div = elm.shadowRoot.querySelector('div');

// eslint-disable-next-line jest/valid-expect
// eslint-disable-next-line vitest/valid-expect
let expected = expect(() => {
div.innerHTML = '<span>Hello World!</span>';
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Node.textContent - setter', () => {

const div = elm.shadowRoot.querySelector('div');

// eslint-disable-next-line jest/valid-expect
// eslint-disable-next-line vitest/valid-expect
let expected = expect(() => {
div.textContent = '<span>Hello World!</span>';
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('dom mutation without the lwc:dom="manual" directive', () => {
document.body.appendChild(root);
const elm = root.shadowRoot.querySelector('div');

// eslint-disable-next-line jest/valid-expect
// eslint-disable-next-line vitest/valid-expect
let expected = expect(() => fn(elm));
if (process.env.NATIVE_SHADOW) {
expected = expected.not; // no error
Expand Down
17 changes: 5 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3215,7 +3215,7 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0":
"@typescript-eslint/[email protected]":
version "8.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.13.0.tgz#f6d40e8b5053dcaeabbd2e26463857abf27d62c0"
integrity sha512-A1EeYOND6Uv250nybnLZapeXpYMl8tkzYUxqmoKAWnI4sei3ihf2XdZVd+vVOmHGcp3t+P7yRrNsyyiXTvShFQ==
Expand Down Expand Up @@ -3251,10 +3251,10 @@
test-exclude "^7.0.1"
tinyrainbow "^1.2.0"

"@vitest/eslint-plugin@^1.1.8":
version "1.1.8"
resolved "https://registry.yarnpkg.com/@vitest/eslint-plugin/-/eslint-plugin-1.1.8.tgz#4b3a96df1a91ab6addf13a043a76dffbf7defcf2"
integrity sha512-Vej6LT38XxPayXi1RoiExxWgZWuNsx7kMudvRXHsuoYl0BykFB7vAR2OwFpuVFCkW35UW/DQ3EYB1Qj3IYHXvQ==
"@vitest/eslint-plugin@^1.1.10":
version "1.1.10"
resolved "https://registry.yarnpkg.com/@vitest/eslint-plugin/-/eslint-plugin-1.1.10.tgz#db46986904493b9824057f4385cd75b49cad320f"
integrity sha512-uScH5Kz5v32vvtQYB2iodpoPg2mGASK+VKpjlc2IUgE0+16uZKqVKi2vQxjxJ6sMCQLBs4xhBFZlmZBszsmfKQ==

"@vitest/[email protected]":
version "2.1.4"
Expand Down Expand Up @@ -6102,13 +6102,6 @@ eslint-plugin-import@^2.31.0:
string.prototype.trimend "^1.0.8"
tsconfig-paths "^3.15.0"

eslint-plugin-jest@^28.9.0:
version "28.9.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz#19168dfaed124339cd2252c4c4d1ac3688aeb243"
integrity sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==
dependencies:
"@typescript-eslint/utils" "^6.0.0 || ^7.0.0 || ^8.0.0"

eslint-scope@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442"
Expand Down