Skip to content

Commit db63a8e

Browse files
authored
Merge pull request #693 from GetStream/remove-sonarjs
remove-sonarjs
2 parents 3b4e74c + 3c9d047 commit db63a8e

File tree

28 files changed

+8
-55
lines changed

28 files changed

+8
-55
lines changed

.eslintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"plugins": [
44
"babel",
55
"markdown",
6-
"sonarjs",
76
"prettier",
87
"react-hooks",
98
"jest-dom",
@@ -15,8 +14,7 @@
1514
"airbnb-base",
1615
"plugin:prettier/recommended",
1716
"plugin:jest/all",
18-
"plugin:jest-dom/recommended",
19-
"plugin:sonarjs/recommended"
17+
"plugin:jest-dom/recommended"
2018
],
2119
"rules": {
2220
"no-console": 0,
@@ -37,7 +35,6 @@
3735
"jest/lowercase-name": 0,
3836
"jest/prefer-expect-assertions": 0,
3937
"jest/no-hooks": 0,
40-
"sonarjs/cognitive-complexity": ["error", 30],
4138
"no-unused-expressions": "off",
4239
"babel/no-unused-expressions": "error",
4340
"jest/no-if": "off"

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
"babel-plugin-i18next-extract": "^0.8.2",
9090
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
9191
"codecov": "^3.8.1",
92-
"css-loader": "^5.0.1",
9392
"core-js": "^3.6.5",
93+
"css-loader": "^5.0.1",
9494
"eslint": "7.14.0",
9595
"eslint-config-airbnb": "^18.2.1",
9696
"eslint-config-prettier": "^6.15.0",
@@ -109,7 +109,6 @@
109109
"eslint-plugin-promise": "^4.2.1",
110110
"eslint-plugin-react": "^7.21.5",
111111
"eslint-plugin-react-hooks": "^4.2.0",
112-
"eslint-plugin-sonarjs": "^0.5.0",
113112
"htmlparser2": "^5.0.1",
114113
"husky": "^4.3.0",
115114
"jest": "^26.6.3",

src/components/Attachment/__tests__/Attachment.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable sonarjs/no-identical-functions */
2-
/* eslint-disable sonarjs/no-duplicate-string */
31
import React from 'react';
42
import { render, waitFor } from '@testing-library/react';
53
import '@testing-library/jest-dom';

src/components/Avatar/__tests__/Avatar.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable sonarjs/no-duplicate-string */
21
import React from 'react';
32
import renderer from 'react-test-renderer';
43
import { cleanup, render, fireEvent } from '@testing-library/react';

src/components/Channel/Channel.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable sonarjs/no-duplicate-string */
21
import React, {
32
useEffect,
43
useCallback,
@@ -58,7 +57,6 @@ const ChannelInner = ({
5857
LoadingIndicator = DefaultLoadingIndicator,
5958
Message = MessageSimple,
6059
...props
61-
// eslint-disable-next-line sonarjs/cognitive-complexity
6260
}) => {
6361
const { channel } = props;
6462

src/components/Channel/__tests__/Channel.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ describe('Channel', () => {
214214
await waitFor(() => expect(doMarkReadRequest).toHaveBeenCalledTimes(1));
215215
});
216216

217-
// eslint-disable-next-line sonarjs/cognitive-complexity
218217
describe('Children that consume ChannelContext', () => {
219218
it('should expose the emoji config', async () => {
220219
let context;

src/components/ChannelHeader/__tests__/ChannelHeader.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable sonarjs/no-duplicate-string */
21
import React from 'react';
32
import { render, cleanup, waitFor } from '@testing-library/react';
43
import '@testing-library/jest-dom';

src/components/ChannelList/__tests__/ChannelList.test.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable sonarjs/no-duplicate-string */
21
import React from 'react';
32
// eslint-disable-next-line import/no-extraneous-dependencies
43
import { getNodeText } from '@testing-library/dom';
@@ -44,8 +43,8 @@ import {
4443

4544
/**
4645
* We are gonna use following custom UI components for preview and list.
47-
* If we use ChannelPreviewMessanger or ChannelPreviewLastmessage here, then changes
48-
* to those components might endup breaking tests for ChannelList, which will be quite painful
46+
* If we use ChannelPreviewMessenger or ChannelPreviewLastMessage here, then changes
47+
* to those components might end up breaking tests for ChannelList, which will be quite painful
4948
* to debug then.
5049
*/
5150
const ChannelPreviewComponent = ({
@@ -628,7 +627,6 @@ describe('ChannelList', () => {
628627
expect(getByRole('list')).toBeInTheDocument();
629628
});
630629

631-
// eslint-disable-next-line sonarjs/no-identical-functions
632630
act(() =>
633631
dispatchNotificationAddedToChannelEvent(
634632
chatClientUthred,
@@ -649,7 +647,6 @@ describe('ChannelList', () => {
649647
List: ChannelListComponent,
650648
};
651649

652-
// eslint-disable-next-line sonarjs/no-identical-functions
653650
beforeEach(() => {
654651
useMockedApis(chatClientUthred, [
655652
queryChannelsApi([testChannel1, testChannel2, testChannel3]),
@@ -694,7 +691,7 @@ describe('ChannelList', () => {
694691
await waitFor(() => {
695692
expect(getByRole('list')).toBeInTheDocument();
696693
});
697-
// eslint-disable-next-line sonarjs/no-identical-functions
694+
698695
act(() =>
699696
dispatchNotificationRemovedFromChannel(
700697
chatClientUthred,
@@ -763,7 +760,7 @@ describe('ChannelList', () => {
763760
});
764761

765762
const newChannelName = uuidv4();
766-
// eslint-disable-next-line sonarjs/no-identical-functions
763+
767764
act(() =>
768765
dispatchChannelUpdatedEvent(chatClientUthred, {
769766
...testChannel2.channel,
@@ -784,7 +781,6 @@ describe('ChannelList', () => {
784781
List: ChannelListComponent,
785782
};
786783

787-
// eslint-disable-next-line sonarjs/no-identical-functions
788784
beforeEach(() => {
789785
useMockedApis(chatClientUthred, [
790786
queryChannelsApi([testChannel1, testChannel2]),
@@ -874,7 +870,6 @@ describe('ChannelList', () => {
874870
List: ChannelListComponent,
875871
};
876872

877-
// eslint-disable-next-line sonarjs/no-identical-functions
878873
beforeEach(() => {
879874
useMockedApis(chatClientUthred, [
880875
queryChannelsApi([testChannel1, testChannel2]),
@@ -992,7 +987,6 @@ describe('ChannelList', () => {
992987
expect(getByRole('list')).toBeInTheDocument();
993988
});
994989

995-
// eslint-disable-next-line sonarjs/no-identical-functions
996990
act(() =>
997991
dispatchChannelVisibleEvent(chatClientUthred, testChannel3.channel),
998992
);

src/components/ChannelList/__tests__/ChannelListMessenger.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
/* eslint-disable sonarjs/no-unused-collection */
21
import React from 'react';
32
import { cleanup } from '@testing-library/react';
43
import '@testing-library/jest-dom';
54
import renderer from 'react-test-renderer';
65
import { ChannelListMessenger } from '..';
76

8-
// Wierd hack to avoid big warnings
7+
// Weird hack to avoid big warnings
98
// Maybe better to find a better solution for it.
109
console.warn = () => null;
1110

src/components/ChannelList/__tests__/ChannelListTeam.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable sonarjs/no-unused-collection */
21
import React from 'react';
32
import { cleanup, render, waitFor } from '@testing-library/react';
43
import '@testing-library/jest-dom';
@@ -7,7 +6,7 @@ import { getTestClientWithUser } from 'mock-builders';
76
import { ChannelListTeam } from '..';
87
import { ChatContext } from '../../../context';
98

10-
// Wierd hack to avoid big warnings
9+
// Weird hack to avoid big warnings
1110
// Maybe better to find a better solution for it.
1211
console.warn = () => null;
1312

0 commit comments

Comments
 (0)