Skip to content

Commit

Permalink
chore: upgrade eslint config deps (#4977)
Browse files Browse the repository at this point in the history
* chore: upgrade eslint config deps

* Upgrade deps @typescript-eslint

* Update changeset description

* Update yarn lock

* Update eslint version used in some packages

* Fix randomly failing UT

* chore: yarn-deduplicate

* Commit to start CI again

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jmainguytalend and github-actions[bot] authored Nov 10, 2023
1 parent 46724c1 commit e82cc7f
Show file tree
Hide file tree
Showing 31 changed files with 1,270 additions and 524 deletions.
41 changes: 41 additions & 0 deletions .changeset/dirty-flies-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
'@talend/eslint-config': major
---

Upgrade some dependencies to latest version.

__NOTE : Some lint rules may have their severity updated.__

Updated libs with breaking changes :

```
"dependencies": {
(...)
// 6.10.0 => breaking changes : https://typescript-eslint.io/blog/announcing-typescript-eslint-v6
"@typescript-eslint/parser": "^5.62.0",
// 6.10.0 => breaking changes : https://typescript-eslint.io/blog/announcing-typescript-eslint-v6
"@typescript-eslint/eslint-plugin": "^5.62.0",
// 8.53.0 => breaking changes : https://eslint.org/docs/latest/use/migrate-to-8.0.0
"eslint": "^7.32.0",
(...)
// 7.x.x => breaking changes : https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-700-2020-12-05
// 8.x.x => breaking changes : https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
// 9.0.0 => breaking changes : https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-900-2023-08-05
"eslint-config-prettier": "^6.15.0",
(...)
// 5.1.0 => breaking changes : https://github.com/testing-library/eslint-plugin-jest-dom/releases/tag/v5.0.0
"eslint-plugin-jest-dom": "^4.0.3",
(...)
// 6.0.0 => breaking changes : https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/migration-guides/v6.md
"eslint-plugin-testing-library": "^5.11.1"
}
```
2 changes: 1 addition & 1 deletion fork/module-to-cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
"eslint": "^7.32.0",
"eslint": "^8.53.0",
"jest": "^29.7.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@changesets/cli": "^2.26.2",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"eslint": "^7.32.0",
"eslint": "^8.53.0",
"husky": "^8.0.3",
"i18next-scanner": "^4.4.0",
"lint-staged": "^13.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */

import HorizontalBarChart from './HorizontalBarChart.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable cypress/unsafe-to-chain-command */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
import { Accordion, CollapsiblePanel } from './';

Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Badge/Badge.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import { BadgeDropdown, BadgePopover, BadgeTag, BadgeValue } from '.';

/* eslint-disable testing-library/prefer-screen-queries */
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Button/Button.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable cypress/unsafe-to-chain-command */
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import { useState } from 'react';

import ButtonPrimitive from './Primitive/ButtonPrimitive';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable no-console */
import { Dropdown } from './';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
import { useState } from 'react';
import Fieldset from './Fieldset';
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Icon/Icon.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-utils */
import { Icon } from '.';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import { IconsProvider } from '.';

context('<IconsProvider />', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable cypress/unsafe-to-chain-command */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
import { InlineEditing } from './';

Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Link/Link.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
import { Link } from './';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
import { LinkAsButton } from './';

Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Modal/Modal.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable cypress/unsafe-to-chain-command */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable no-console */
/* eslint-disable testing-library/prefer-screen-queries */
import { useState } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable testing-library/prefer-screen-queries */

/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import { Popover, ButtonPrimary, CollapsiblePanel } from '../../';

context('<Popover />', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import Step from './index';

context('<Step />', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import { Stepper } from '.';

context('<Stepper />', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Tag/Tag.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
/* eslint-disable testing-library/prefer-screen-queries */
import { Tag } from '.';
import { TagVariant } from './Tag';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/await-async-queries */
import { Tooltip } from './Tooltip';

context('<Tooltip />', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/faceted-search/src/CRUDBadges.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const findByMetadataBadgeId =
({ metadata }) =>
get(metadata, 'badgeId') === badgeId;

// eslint-disable-next-line testing-library/await-async-query
// eslint-disable-next-line testing-library/await-async-queries
const getBadgeIndexFromId = badgeId => badges => badges.findIndex(findByMetadataBadgeId(badgeId));

const getBadge = index => badges => badges[index];
Expand Down
6 changes: 4 additions & 2 deletions packages/forms/src/UIForm/fields/File/File.component.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { screen, render } from '@testing-library/react';
import { screen, render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import File, { FileWidget, base64Decode } from './File.component';

Expand Down Expand Up @@ -100,7 +100,9 @@ describe('File field', () => {
// when
const fileInput = document.querySelector('input[type="file"]');
await userEvent.upload(fileInput, blob);
expect(props.onChange).toHaveBeenCalledWith(expect.anything(), { schema, value });
await waitFor(() =>
expect(props.onChange).toHaveBeenCalledWith(expect.anything(), { schema, value }),
);
});

it('should trigger pre-signed url related onChange when user select file', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tools/cmf-webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@babel/eslint-parser": "^7.23.3",
"@talend/eslint-config": "^12.2.0",
"@talend/scripts-config-babel": "^13.1.0",
"eslint": "^7.32.0"
"eslint": "^8.53.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion tools/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
"@talend/scripts-config-babel": "^13.1.0",
"eslint": "^7.32.0",
"eslint": "^8.53.0",
"jest": "^29.7.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
"eslint": "^7.32.0"
"eslint": "^8.53.0"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 6 additions & 2 deletions tools/scripts-config-eslint/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
"testing-library/custom-renders": "off",
"testing-library/custom-queries": "off",
"testing-library/no-node-access": "off",
"testing-library/render-result-naming-convention": "off"
"testing-library/render-result-naming-convention": "off",

"@typescript-eslint/no-explicit-any": 1
},
"overrides": [
{
Expand All @@ -112,5 +114,7 @@
"react": {
"version": "detect"
}
}
},
// Ignore some JS at project's rool level
"ignorePatterns": ["index.js", ".eslintrc.js"]
}
2 changes: 1 addition & 1 deletion tools/scripts-config-eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (isTS) {
.filter(i => !TO_REMOVE.includes(i)),
plugins: config.plugins.concat(['@typescript-eslint']),
parserOptions: {
project: './tsconfig.json',
project: true,
tsconfigRootDir: cwd,
},
rules: {
Expand Down
22 changes: 12 additions & 10 deletions tools/scripts-config-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@
"dependencies": {
"@babel/eslint-parser": "^7.23.3",
"@talend/eslint-plugin": "^1.0.1",
"@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"eslint": "^7.32.0",
"@testing-library/dom": "^9.3.3",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"eslint": "^8.53.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-angular": "^4.1.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest-dom": "^4.0.3",
"eslint-plugin-jest-dom": "^5.1.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-mdx": "^1.17.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-mdx": "^2.2.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^2.5.1",
"eslint-plugin-storybook": "^0.5.13",
"eslint-plugin-testing-library": "^5.11.1"
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-testing-library": "^6.1.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-react-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
"@talend/eslint-config": "^12.2.0",
"eslint": "^7.32.0"
"eslint": "^8.53.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
"eslint": "^7.32.0",
"eslint": "^8.53.0",
"jest": "^29.7.0"
},
"repository": {
Expand Down
Loading

0 comments on commit e82cc7f

Please sign in to comment.