From 3aeea07185ebb2eceeab4a0ec520f7d641d02f39 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 23 Oct 2017 20:38:19 +0200 Subject: use eslint for typescript, update eslint configuration (#2742) --- .../src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx | 2 +- server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx | 3 +-- .../src/main/js/apps/projectsManagement/__tests__/App-test.tsx | 4 +++- .../apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx | 1 + .../js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx | 1 + .../main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx | 1 + .../src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) (limited to 'server/sonar-web/src/main/js/apps/projectsManagement') diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx index 314988d7eed..3e81e28cb5c 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx @@ -69,7 +69,7 @@ export default class BulkApplyTemplateModal extends React.PureComponent 0 ? permissionTemplates[0].id : undefined, - permissionTemplates: permissionTemplates + permissionTemplates }); } }, diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx index d41a5c5e1bb..94318dbae7c 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx @@ -22,8 +22,7 @@ import * as Select from 'react-select'; import { sortBy } from 'lodash'; import BulkApplyTemplateModal from './BulkApplyTemplateModal'; import DeleteModal from './DeleteModal'; -import { QUALIFIERS_ORDER } from './utils'; -import { Project } from './utils'; +import { QUALIFIERS_ORDER, Project } from './utils'; import { Organization } from '../../app/types'; import Checkbox from '../../components/controls/Checkbox'; import { translate } from '../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx index 0fb6b1d21d0..dadd3a45a1b 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* eslint-disable import/first, import/order */ jest.mock('lodash', () => { const lodash = require.requireActual('lodash'); lodash.debounce = (fn: Function) => (...args: any[]) => fn(args); @@ -25,6 +26,7 @@ jest.mock('lodash', () => { // actual version breaks `mount` jest.mock('rc-tooltip', () => ({ + // eslint-disable-next-line default: function Tooltip() { return null; } @@ -81,7 +83,7 @@ it('searches', () => { expect(getComponents).lastCalledWith({ ...defaultSearchParameters, q: 'foo', qualifiers: 'TRK' }); }); -it('loads more', async () => { +it('loads more', () => { const wrapper = mountRender(); wrapper.find('ListFooter').prop('loadMore')(); expect(getComponents).lastCalledWith({ ...defaultSearchParameters, p: 2, qualifiers: 'TRK' }); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx index cdb33cf7f33..75368168411 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* eslint-disable import/first, import/order */ jest.mock('../../../api/permissions', () => ({ bulkApplyTemplate: jest.fn(() => Promise.resolve()), getPermissionTemplates: jest.fn(() => Promise.resolve({ permissionTemplates: [] })) diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx index bd8c3114b4e..c514345b78a 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* eslint-disable import/first, import/order */ jest.mock('../../../api/components', () => ({ createProject: jest.fn(({ name }: { name: string }) => Promise.resolve({ project: { key: name, name } }) diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx index 976be4403a8..d73e5306632 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* eslint-disable import/first, import/order */ jest.mock('../../../api/components', () => ({ bulkDeleteProjects: jest.fn(() => Promise.resolve()) })); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx index 792e29ccc48..cc29a0e243d 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* eslint-disable import/first */ jest.mock('../../permissions/project/views/ApplyTemplateView'); import * as React from 'react'; -- cgit v1.2.3