Skip to content

Commit 87dc881

Browse files
renovate[bot]renovate-bothzhu
authored
chore(deps): update dependency @zendeskgarden/eslint-config to v26 (#1261)
* chore(deps): update dependency @zendeskgarden/eslint-config to v26 * Update eslint dependencies, tests, & config Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: hzhu <[email protected]>
1 parent 68bad0e commit 87dc881

File tree

16 files changed

+411
-394
lines changed

16 files changed

+411
-394
lines changed

.storybook/main.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
const webpack = require('webpack');
99
const externalConfig = require('../.svgo.config.js');
10+
const ESLintPlugin = require('eslint-webpack-plugin');
1011
const docs = process.env.BROWSER ? process.env.BROWSER.toUpperCase() !== 'IE11' : true;
1112

1213
module.exports = {
@@ -20,19 +21,6 @@ module.exports = {
2021

2122
fileLoaderRule.exclude = /@zendeskgarden\/svg-icons/u;
2223

23-
config.module.rules.push({
24-
test: /\.tsx?$/u,
25-
use: [
26-
{
27-
loader: 'eslint-loader',
28-
options: {
29-
emitWarning: true
30-
}
31-
}
32-
],
33-
enforce: 'pre'
34-
});
35-
3624
config.module.rules.push({
3725
test: /\.svg$/u,
3826
use: [
@@ -48,7 +36,8 @@ module.exports = {
4836
config.plugins.push(
4937
new webpack.DefinePlugin({
5038
PACKAGE_VERSION: JSON.stringify('storybook')
51-
})
39+
}),
40+
new ESLintPlugin({ emitWarning: true, extensions: '.tsx' })
5241
);
5342

5443
return config;

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"devDependencies": {
3131
"@babel/cli": "7.16.0",
3232
"@babel/core": "7.16.5",
33+
"@babel/eslint-parser": "^7.16.5",
3334
"@babel/plugin-proposal-class-properties": "7.16.5",
3435
"@babel/plugin-proposal-object-rest-spread": "7.16.5",
3536
"@babel/plugin-transform-object-assign": "7.16.5",
@@ -55,16 +56,15 @@
5556
"@types/react": "17.0.37",
5657
"@types/react-dom": "17.0.11",
5758
"@types/styled-components": "5.1.18",
58-
"@typescript-eslint/eslint-plugin": "4.33.0",
59-
"@typescript-eslint/parser": "4.33.0",
59+
"@typescript-eslint/eslint-plugin": "5.7.0",
60+
"@typescript-eslint/parser": "5.7.0",
6061
"@zendeskgarden/css-bedrock": "9.0.0",
61-
"@zendeskgarden/eslint-config": "21.0.0",
62+
"@zendeskgarden/eslint-config": "26.0.0",
6263
"@zendeskgarden/scripts": "1.4.0",
6364
"@zendeskgarden/stylelint-config": "16.0.1",
6465
"@zendeskgarden/svg-icons": "6.30.2",
6566
"acorn-jsx": "5.3.2",
6667
"babel-core": "7.0.0-bridge.0",
67-
"babel-eslint": "10.1.0",
6868
"babel-jest": "26.6.3",
6969
"babel-loader": "8.2.3",
7070
"babel-plugin-module-resolver": "4.1.0",
@@ -76,16 +76,16 @@
7676
"coveralls": "3.1.1",
7777
"enhanced-resolve": "4.5.0",
7878
"envalid": "7.2.2",
79-
"eslint": "7.32.0",
79+
"eslint": "8.4.1",
8080
"eslint-config-prettier": "8.3.0",
81-
"eslint-loader": "4.0.2",
8281
"eslint-plugin-garden-local": "file:./utils/eslint",
83-
"eslint-plugin-jest": "24.7.0",
82+
"eslint-plugin-jest": "25.3.0",
8483
"eslint-plugin-jsx-a11y": "6.5.1",
8584
"eslint-plugin-node": "11.1.0",
8685
"eslint-plugin-notice": "0.9.10",
8786
"eslint-plugin-react": "7.27.1",
8887
"eslint-plugin-react-hooks": "4.3.0",
88+
"eslint-webpack-plugin": "^3.1.1",
8989
"execa": "5.1.1",
9090
"fork-ts-checker-webpack-plugin": "6.5.0",
9191
"fuzzy": "0.1.3",

packages/avatars/src/elements/Avatar.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ describe('Avatar', () => {
5555
});
5656

5757
it('renders text element if provided', () => {
58-
const { getByTestId } = render(
58+
const { getByText } = render(
5959
<Avatar>
60-
<Avatar.Text data-test-id="text">AG</Avatar.Text>
60+
<Avatar.Text>AG</Avatar.Text>
6161
</Avatar>
6262
);
6363

64-
expect(getByTestId('text')).not.toBeUndefined();
64+
expect(getByText('AG')).toBeDefined();
6565
});
6666

6767
describe('Invalid', () => {

packages/chrome/src/elements/header/HeaderItem.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ describe('HeaderItem', () => {
5454
talk: PALETTE.product.talk
5555
};
5656

57-
PRODUCTS.forEach(product => {
58-
it(`renders correct ${product} color if provided`, () => {
57+
it('renders correct product color', () => {
58+
PRODUCTS.forEach(product => {
5959
const { container } = render(<HeaderItem hasLogo product={product} />);
6060

6161
expect(container.firstChild).toHaveStyleRule('color', VALID_COLOR_MAP[product]);

packages/chrome/src/elements/nav/NavItem.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ describe('NavItem', () => {
154154
talk: PALETTE.product.talk
155155
};
156156

157-
PRODUCTS.forEach(product => {
158-
it(`renders correct ${product} color if provided`, () => {
157+
it('renders correct product color if provided', () => {
158+
PRODUCTS.forEach(product => {
159159
const { container } = render(<NavItem hasLogo product={product} />);
160160

161161
expect(container.firstChild).toHaveStyleRule('color', VALID_COLOR_MAP[product]);

packages/dropdowns/src/elements/Dropdown/Dropdown.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export interface IDropdownProps {
5555
stateAndHelpers: ControllerStateAndHelpers<any>
5656
) => void;
5757
/** Passes customization props to the [Downshift](https://www.downshift-js.com/) component */
58-
// eslint-disable-next-line @typescript-eslint/ban-types
59-
downshiftProps?: object;
58+
downshiftProps?: Record<string, any>;
6059
}
6160

6261
const Dropdown: React.FunctionComponent<IDropdownProps & ThemeProps<DefaultTheme>> = props => {

packages/forms/src/elements/common/Message.spec.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,16 @@ describe('Message', () => {
7272
});
7373

7474
describe('Validation', () => {
75-
(['success', 'warning', 'error'] as VALIDATION[]).forEach(validation => {
76-
it(`renders expected ${validation} component`, () => {
77-
const { getByTestId } = render(
75+
it('renders expected component for each validation type', () => {
76+
(['success', 'warning', 'error'] as VALIDATION[]).forEach(validation => {
77+
const text = `This is ${validation} text`;
78+
const { getByText } = render(
7879
<Field>
79-
<Message data-test-id="message" validation={validation}>
80-
Test
81-
</Message>
80+
<Message validation={validation}>{text}</Message>
8281
</Field>
8382
);
8483

85-
expect(getByTestId('message').firstChild!.nodeName).toBe('svg');
84+
expect(getByText(text).firstChild!.nodeName).toBe('svg');
8685
});
8786
});
8887
});

packages/forms/src/styled/common/StyledMessageIcon.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ describe('StyledMessageIcon', () => {
2323
});
2424

2525
describe('Validation', () => {
26-
(['success', 'warning', 'error'] as VALIDATION[]).forEach(validation => {
27-
it(`renders ${validation} styling if provided`, () => {
26+
it('renders validation styling', () => {
27+
(['success', 'warning', 'error'] as VALIDATION[]).forEach(validation => {
2828
const { container } = render(<StyledMessageIcon validation={validation} />);
2929

3030
expect(container.firstChild!.nodeName).toBe('svg');

0 commit comments

Comments
 (0)