Fix more ESLint errors (#5619)

main
Roman Donchenko 3 years ago committed by GitHub
parent 54e3198602
commit 41c6728528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,7 +39,7 @@ module.exports = {
'func-names': 0, 'func-names': 0,
'valid-typeof': 0, 'valid-typeof': 0,
'no-useless-constructor': 0, // sometimes constructor is necessary to generate right documentation in cvat-core 'no-useless-constructor': 0, // sometimes constructor is necessary to generate right documentation in cvat-core
'quotes': ['error', 'single'], 'quotes': ['error', 'single', { "avoidEscape": true }],
'lines-between-class-members': 0, 'lines-between-class-members': 0,
'class-methods-use-this': 0, 'class-methods-use-this': 0,
'no-underscore-dangle': ['error', { allowAfterThis: true }], 'no-underscore-dangle': ['error', { allowAfterThis: true }],

@ -97,7 +97,7 @@ describe('Feature: save a project', () => {
const labelsLength = result[0].labels.length; const labelsLength = result[0].labels.length;
const newLabel = new window.cvat.classes.Label({ const newLabel = new window.cvat.classes.Label({
name: 'My boss\'s car', name: "My boss's car",
attributes: [ attributes: [
{ {
default_value: 'false', default_value: 'false',
@ -117,7 +117,7 @@ describe('Feature: save a project', () => {
}); });
expect(result[0].labels).toHaveLength(labelsLength + 1); expect(result[0].labels).toHaveLength(labelsLength + 1);
const appendedLabel = result[0].labels.filter((el) => el.name === 'My boss\'s car'); const appendedLabel = result[0].labels.filter((el) => el.name === "My boss's car");
expect(appendedLabel).toHaveLength(1); expect(appendedLabel).toHaveLength(1);
expect(appendedLabel[0].attributes).toHaveLength(1); expect(appendedLabel[0].attributes).toHaveLength(1);
expect(appendedLabel[0].attributes[0].name).toBe('parked'); expect(appendedLabel[0].attributes[0].name).toBe('parked');

@ -124,7 +124,7 @@ describe('Feature: save a task', () => {
const labelsLength = result[0].labels.length; const labelsLength = result[0].labels.length;
const newLabel = new window.cvat.classes.Label({ const newLabel = new window.cvat.classes.Label({
name: 'My boss\'s car', name: "My boss's car",
attributes: [ attributes: [
{ {
default_value: 'false', default_value: 'false',
@ -144,7 +144,7 @@ describe('Feature: save a task', () => {
}); });
expect(result[0].labels).toHaveLength(labelsLength + 1); expect(result[0].labels).toHaveLength(labelsLength + 1);
const appendedLabel = result[0].labels.filter((el) => el.name === 'My boss\'s car'); const appendedLabel = result[0].labels.filter((el) => el.name === "My boss's car");
expect(appendedLabel).toHaveLength(1); expect(appendedLabel).toHaveLength(1);
expect(appendedLabel[0].attributes).toHaveLength(1); expect(appendedLabel[0].attributes).toHaveLength(1);
expect(appendedLabel[0].attributes[0].name).toBe('parked'); expect(appendedLabel[0].attributes[0].name).toBe('parked');
@ -158,7 +158,7 @@ describe('Feature: save a task', () => {
name: 'New Task', name: 'New Task',
labels: [ labels: [
{ {
name: 'My boss\'s car', name: "My boss's car",
attributes: [ attributes: [
{ {
default_value: 'false', default_value: 'false',

@ -48,8 +48,7 @@ export default function LabelMapperItem(props: LabelMapperItemProps): JSX.Elemen
className='cvat-move-task-label-mapper-item-select' className='cvat-move-task-label-mapper-item-select'
disabled={typeof projectLabels === 'undefined'} disabled={typeof projectLabels === 'undefined'}
value={value.newLabelName || ''} value={value.newLabelName || ''}
onChange={(_value) => onChange={(_value) => onChange({
onChange({
...value, ...value,
newLabelName: _value as string, newLabelName: _value as string,
})} })}
@ -67,8 +66,7 @@ export default function LabelMapperItem(props: LabelMapperItemProps): JSX.Elemen
<Checkbox <Checkbox
disabled disabled
checked={value.clearAttributes} checked={value.clearAttributes}
onChange={(_value) => onChange={(_value) => onChange({
onChange({
...value, ...value,
clearAttributes: _value.target.checked, clearAttributes: _value.target.checked,
})} })}

@ -28,7 +28,7 @@ export default function DetailsComponent(props: DetailsComponentProps): JSX.Elem
const [projectName, setProjectName] = useState(project.name); const [projectName, setProjectName] = useState(project.name);
return ( return (
<div cvat-project-id={project.id} className='cvat-project-details'> <div data-cvat-project-id={project.id} className='cvat-project-details'>
<Row> <Row>
<Col> <Col>
<Title <Title

@ -189,14 +189,14 @@ context('New organization pipeline.', () => {
cy.closeNotification('.cvat-notification-notice-leave-organization-failed'); cy.closeNotification('.cvat-notification-notice-leave-organization-failed');
}); });
it('The second user login. The user is able to see the organization, can\'t see the task.', () => { it("The second user login. The user is able to see the organization, can't see the task.", () => {
cy.logout(); cy.logout();
cy.login(secondUserName, secondUser.password); cy.login(secondUserName, secondUser.password);
cy.checkOrganizationExists(organizationParams.shortName); cy.checkOrganizationExists(organizationParams.shortName);
cy.contains('.cvat-item-task-name', taskName).should('not.exist'); cy.contains('.cvat-item-task-name', taskName).should('not.exist');
}); });
it('The second user activates the organization, can\'t see the project because it is not assigned to him.', () => { it("The second user activates the organization, can't see the project because it is not assigned to him.", () => {
cy.activateOrganization(organizationParams.shortName); cy.activateOrganization(organizationParams.shortName);
cy.goToProjectsList(); cy.goToProjectsList();
cy.contains('.cvat-projects-project-item-title', project.name).should('not.exist'); cy.contains('.cvat-projects-project-item-title', project.name).should('not.exist');
@ -232,7 +232,7 @@ context('New organization pipeline.', () => {
}); });
}); });
it('Logout, the third user login. The user does not see the project, the task. The user can\'t open the job using direct link.', () => { it("Logout, the third user login. The user does not see the project, the task. The user can't open the job using direct link.", () => {
cy.logout(secondUserName); cy.logout(secondUserName);
cy.login(thirdUserName, thirdUser.password); cy.login(thirdUserName, thirdUser.password);
cy.contains('.cvat-item-task-name', taskName).should('not.exist'); cy.contains('.cvat-item-task-name', taskName).should('not.exist');

@ -31,7 +31,7 @@ context('Delete a label from a project.', () => {
function getProjectID() { function getProjectID() {
cy.contains('.cvat-project-name', projectName) cy.contains('.cvat-project-name', projectName)
.parents('.cvat-project-details') .parents('.cvat-project-details')
.should('have.attr', 'cvat-project-id') .should('have.attr', 'data-cvat-project-id')
.then(($projectID) => { .then(($projectID) => {
projectID = $projectID; projectID = $projectID;
}); });

@ -47,7 +47,7 @@ context('Base actions on the project', () => {
function getProjectID(myProjectName) { function getProjectID(myProjectName) {
cy.contains('.cvat-project-name', myProjectName) cy.contains('.cvat-project-name', myProjectName)
.parents('.cvat-project-details') .parents('.cvat-project-details')
.should('have.attr', 'cvat-project-id') .should('have.attr', 'data-cvat-project-id')
.then(($projectID) => { .then(($projectID) => {
projectID = $projectID; projectID = $projectID;
}); });

@ -40,7 +40,7 @@ context('Rotate all images feature.', () => {
imageRotate('anticlockwise', 270); imageRotate('anticlockwise', 270);
}); });
it('Go to the next frame. It wasn\'t rotated.', () => { it("Go to the next frame. It wasn't rotated.", () => {
cy.get('.cvat-player-next-button').click(); cy.get('.cvat-player-next-button').click();
checkFrameNum(1); checkFrameNum(1);
checkDegRotate(0); checkDegRotate(0);

@ -6,7 +6,7 @@
import { taskName, labelName } from '../../support/const'; import { taskName, labelName } from '../../support/const';
context('The points of the previous polygon mustn\'t appear while polygon\'s interpolation.', () => { context("The points of the previous polygon mustn't appear while polygon's interpolation.", () => {
const issueId = '1882'; const issueId = '1882';
const createPolygonTrack = { const createPolygonTrack = {
reDraw: false, reDraw: false,
@ -48,7 +48,7 @@ context('The points of the previous polygon mustn\'t appear while polygon\'s int
.trigger('mousemove', { force: true }) .trigger('mousemove', { force: true })
.trigger('keydown', { keyCode: keyCodeN, code: 'KeyN', shiftKey: true }) .trigger('keydown', { keyCode: keyCodeN, code: 'KeyN', shiftKey: true })
.trigger('keyup', { .trigger('keyup', {
force: true, keyCode: keyCodeN, code: 'KeyN', shiftKey: true force: true, keyCode: keyCodeN, code: 'KeyN', shiftKey: true,
}); });
cy.createPolygon(reDrawPolygonTrack); cy.createPolygon(reDrawPolygonTrack);
}); });

@ -6,7 +6,7 @@
import { taskName, advancedConfigurationParams, labelName } from '../../support/const'; import { taskName, advancedConfigurationParams, labelName } from '../../support/const';
context('Point coordinates are not duplicated while polygon\'s interpolation.', () => { context("Point coordinates are not duplicated while polygon's interpolation.", () => {
const issueId = '1886'; const issueId = '1886';
const pointsCoordinates = []; const pointsCoordinates = [];
const createPolygonTrack = { const createPolygonTrack = {

@ -44,7 +44,7 @@ it('Prepare to testing', () => {
listItems.push(collection[i].innerText); listItems.push(collection[i].innerText);
} }
if (listItems.indexOf(taskName) === -1) { if (listItems.indexOf(taskName) === -1) {
cy.task('log', 'A task doesn\'t exist. Creating.'); cy.task('log', "A task doesn't exist. Creating.");
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount); cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath); cy.createZipArchive(directoryToArchive, archivePath);
cy.createAnnotationTask( cy.createAnnotationTask(

Loading…
Cancel
Save