Skip to content

Commit

Permalink
fix(deps): update dependencies
Browse files Browse the repository at this point in the history
- jest: add `prefer-each` rule
- jest: remove `no-jest-import` rule
- jest: fix `unbound-method` condition for ts
  • Loading branch information
ljosberinn committed Sep 6, 2022
1 parent 90b7add commit 13c2a3f
Show file tree
Hide file tree
Showing 44 changed files with 49,370 additions and 49,001 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ npm install --save-dev eslint-config-galex eslint

~~As of January 2021 / due to CRA v5, currently no additional steps are required! 🎉~~

Beginning with `eslint-config-galex` `v3.6.5` or newer, until this disclaimer is removed you need to install the following dependencies additionally:
Beginning with `eslint-config-galex` `v4.2.2` or newer, until this disclaimer is removed you need to install the following dependencies additionally:

- `"eslint-plugin-jest": "26.1.3"`
- `"eslint-plugin-jest": "27.0.1"`

```sh
npm i --save-dev eslint-plugin-jest@26.1.3
npm i --save-dev eslint-plugin-jest@27.0.1

yarn add -D eslint-plugin-jest@26.1.3
yarn add -D eslint-plugin-jest@27.0.1
```

</details>
Expand Down
12 changes: 10 additions & 2 deletions __tests__/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ const normalizeSnapshot = (content: string) => {
return word;
}

return word.slice(word.indexOf(variablePathDelimiter));
// in codespaces, its /
const sanitized = word.split('/').join('\\');

return sanitized.slice(sanitized.indexOf(variablePathDelimiter));
})
.join(' ');
})
Expand All @@ -63,12 +66,17 @@ const normalizeSnapshot = (content: string) => {
const cases = [
{ name: 'create-react-app javascript', path: 'cra-js' },
{ name: 'create-react-app typescript', path: 'cra-ts' },

{ name: 'create-next-app javascript', path: 'next-js' },
{ name: 'create-next-app typescript', path: 'next-ts' },

{ name: 'create-remix javascript', path: 'remix-js' },
{ name: 'create-remix typescript', path: 'remix-ts' },

{ name: 'jest', path: 'jest' },
{ name: 'nest typescript', path: 'next-ts' },

{ name: 'nest typescript', path: 'nest-ts' },

{
name: 'js ts migration mix checkJs off',
path: 'js-ts-migration-mix-checkJs-off',
Expand Down
16 changes: 7 additions & 9 deletions __tests__/overrides/__snapshots__/jest.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ exports[`createJestRules default 1`] = `
"jest/no-identical-title": "error",
"jest/no-interpolation-in-snapshots": "error",
"jest/no-jasmine-globals": "error",
"jest/no-jest-import": "error",
"jest/no-large-snapshots": [
"warn",
{
Expand All @@ -68,6 +67,7 @@ exports[`createJestRules default 1`] = `
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-expect-resolves": "warn",
"jest/prefer-hooks-in-order": "warn",
Expand Down Expand Up @@ -133,7 +133,6 @@ exports[`createJestRules with create-react-app 1`] = `
"jest/no-identical-title": "error",
"jest/no-interpolation-in-snapshots": "error",
"jest/no-jasmine-globals": "error",
"jest/no-jest-import": "error",
"jest/no-large-snapshots": [
"warn",
{
Expand All @@ -149,6 +148,7 @@ exports[`createJestRules with create-react-app 1`] = `
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-hooks-on-top": "error",
"jest/prefer-inline-snapshots": "off",
Expand All @@ -160,7 +160,6 @@ exports[`createJestRules with create-react-app 1`] = `
"jest/prefer-todo": "warn",
"jest/require-to-throw-message": "off",
"jest/require-top-level-describe": "off",
"jest/unbound-method": "warn",
"jest/valid-expect": "error",
"jest/valid-expect-in-promise": "error",
"jest/valid-title": "warn",
Expand Down Expand Up @@ -229,7 +228,6 @@ exports[`createJestRules with typescript 1`] = `
"jest/no-identical-title": "error",
"jest/no-interpolation-in-snapshots": "error",
"jest/no-jasmine-globals": "error",
"jest/no-jest-import": "error",
"jest/no-large-snapshots": [
"warn",
{
Expand All @@ -245,6 +243,7 @@ exports[`createJestRules with typescript 1`] = `
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-expect-resolves": "warn",
"jest/prefer-hooks-in-order": "warn",
Expand All @@ -259,6 +258,7 @@ exports[`createJestRules with typescript 1`] = `
"jest/prefer-todo": "warn",
"jest/require-to-throw-message": "off",
"jest/require-top-level-describe": "off",
"jest/unbound-method": "warn",
"jest/valid-describe-callback": "error",
"jest/valid-expect": "error",
"jest/valid-expect-in-promise": "error",
Expand All @@ -280,7 +280,6 @@ exports[`createJestRules with typescript 1`] = `
exports[`createTestOverrides with react 1`] = `
{
"import/no-namespace": "off",
"jest/unbound-method": "warn",
"jsx-a11y/control-has-associated-label": "off",
"no-empty-function": "off",
"no-param-reassign": "off",
Expand All @@ -299,6 +298,7 @@ exports[`createTestOverrides with typescript 1`] = `
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/unbound-method": "off",
"import/no-namespace": "off",
"jest/unbound-method": "warn",
"no-empty-function": "off",
"no-param-reassign": "off",
"require-unicode-regexp": "off",
Expand Down Expand Up @@ -459,7 +459,6 @@ exports[`override snapshots with jest-dom 1`] = `
"jest/no-identical-title": "error",
"jest/no-interpolation-in-snapshots": "error",
"jest/no-jasmine-globals": "error",
"jest/no-jest-import": "error",
"jest/no-large-snapshots": [
"warn",
{
Expand All @@ -475,6 +474,7 @@ exports[`override snapshots with jest-dom 1`] = `
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-expect-resolves": "warn",
"jest/prefer-hooks-in-order": "warn",
Expand All @@ -489,7 +489,6 @@ exports[`override snapshots with jest-dom 1`] = `
"jest/prefer-todo": "warn",
"jest/require-to-throw-message": "off",
"jest/require-top-level-describe": "off",
"jest/unbound-method": "warn",
"jest/valid-describe-callback": "error",
"jest/valid-expect": "error",
"jest/valid-expect-in-promise": "error",
Expand Down Expand Up @@ -553,7 +552,6 @@ exports[`override snapshots with testing-lib 1`] = `
"jest/no-identical-title": "error",
"jest/no-interpolation-in-snapshots": "error",
"jest/no-jasmine-globals": "error",
"jest/no-jest-import": "error",
"jest/no-large-snapshots": [
"warn",
{
Expand All @@ -569,6 +567,7 @@ exports[`override snapshots with testing-lib 1`] = `
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-expect-resolves": "warn",
"jest/prefer-hooks-in-order": "warn",
Expand All @@ -583,7 +582,6 @@ exports[`override snapshots with testing-lib 1`] = `
"jest/prefer-todo": "warn",
"jest/require-to-throw-message": "off",
"jest/require-top-level-describe": "off",
"jest/unbound-method": "warn",
"jest/valid-describe-callback": "error",
"jest/valid-expect": "error",
"jest/valid-expect-in-promise": "error",
Expand Down
4 changes: 2 additions & 2 deletions __tests__/overrides/__snapshots__/react.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3185,7 +3185,7 @@ exports[`override snapshots with remix 1`] = `
"settings": {
"import/ignore": [
"node_modules",
"\\\\.(css|md|svg|json)$",
"\\.(css|md|svg|json)$",
],
"import/resolver": {
"jsconfig": {
Expand Down Expand Up @@ -3499,7 +3499,7 @@ exports[`override snapshots with remix and typescript 1`] = `
"settings": {
"import/ignore": [
"node_modules",
"\\\\.(css|md|svg|json)$",
"\\.(css|md|svg|json)$",
],
"import/parsers": {
"@typescript-eslint/parser": [
Expand Down
9 changes: 3 additions & 6 deletions __tests__/standalone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,9 @@ test('backupExistingEslintrc creates a scoped & formatted backup', () => {
expect(Number.parseInt(parts[length - 2])).toBeLessThan(Date.now());
expect(parts[length - 1]).toContain('bak.json');

expect(string).toMatchInlineSnapshot(`
"{
\\"foo\\": \\"bar\\"
}
"
`);
expect(JSON.parse(string)).toMatchObject({
foo: 'bar',
});
});

describe('generateStandalone', () => {
Expand Down
9 changes: 5 additions & 4 deletions integration/cra-js/eslint-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"env": {
"browser": true,
"node": true
"node": true,
"es6": true
},
"overrides": [
{
Expand Down Expand Up @@ -266,7 +267,8 @@
"plugin:jest-formatting/strict"
],
"files": [
"**/*.?(test|spec).?(ts|js)?(x)"
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
],
"parserOptions": {
"ecmaVersion": 2020
Expand Down Expand Up @@ -305,7 +307,6 @@
"jest/no-identical-title": "error",
"jest/no-interpolation-in-snapshots": "error",
"jest/no-jasmine-globals": "error",
"jest/no-jest-import": "error",
"jest/no-large-snapshots": [
"warn",
{
Expand All @@ -321,6 +322,7 @@
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-hooks-on-top": "error",
"jest/prefer-inline-snapshots": "off",
Expand Down Expand Up @@ -380,7 +382,6 @@
"testing-library/prefer-user-event": "warn",
"testing-library/prefer-wait-for": "warn",
"testing-library/render-result-naming-convention": "off",
"jest/unbound-method": "warn",
"import/no-namespace": "off",
"no-empty-function": "off",
"sonarjs/no-duplicate-string": "off",
Expand Down
2 changes: 1 addition & 1 deletion integration/cra-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"web-vitals": "^2.1.0"
},
"devDependencies": {
"eslint-plugin-jest": "26.1.3"
"eslint-plugin-jest": "27.0.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion integration/cra-js/results.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ESLint v8.21.0
ESLint v8.23.0
writing deps to eslint-config-galex\integration\cra-js\deps.json
writing config cache to eslint-config-galex\integration\cra-js\eslint-config.json
TAP version 13
Expand Down

0 comments on commit 13c2a3f

Please sign in to comment.