From 3738c3cc4ffa9960d43b862ffc7b2a0b49d2368d Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Mon, 15 Apr 2024 11:36:37 +0000 Subject: [PATCH] avoid eslint errors --- .eslintrc.cjs | 3 +++ ui-src/converters/createPenpotArtboard.ts | 1 - ui-src/converters/createPenpotCircle.ts | 1 - ui-src/converters/createPenpotGroup.ts | 1 - ui-src/converters/createPenpotImage.ts | 1 - ui-src/converters/createPenpotRectangle.ts | 1 - ui-src/converters/createPenpotText.ts | 6 +----- ui-src/lib/penpot.d.ts | 3 +-- 8 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 91ca33b..9382192 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -18,5 +18,8 @@ module.exports = { react: { version: 'detect' } + }, + rules: { + '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }] } }; diff --git a/ui-src/converters/createPenpotArtboard.ts b/ui-src/converters/createPenpotArtboard.ts index ac2307b..3614fd4 100644 --- a/ui-src/converters/createPenpotArtboard.ts +++ b/ui-src/converters/createPenpotArtboard.ts @@ -6,7 +6,6 @@ import { createPenpotItem } from '.'; export const createPenpotArtboard = ( file: PenpotFile, - // eslint-disable-next-line @typescript-eslint/no-unused-vars { type, children = [], ...rest }: FrameShape ) => { file.addArtboard({ diff --git a/ui-src/converters/createPenpotCircle.ts b/ui-src/converters/createPenpotCircle.ts index 6ac9ee3..a6101d4 100644 --- a/ui-src/converters/createPenpotCircle.ts +++ b/ui-src/converters/createPenpotCircle.ts @@ -4,7 +4,6 @@ import { CircleShape } from '@ui/lib/types/circle/circleShape'; import { translateFillGradients } from '../translators'; -// eslint-disable-next-line @typescript-eslint/no-unused-vars export const createPenpotCircle = (file: PenpotFile, { type, fills, ...rest }: CircleShape) => { file.createCircle({ type: CIRCLE_TYPE, diff --git a/ui-src/converters/createPenpotGroup.ts b/ui-src/converters/createPenpotGroup.ts index 36770b2..33e639c 100644 --- a/ui-src/converters/createPenpotGroup.ts +++ b/ui-src/converters/createPenpotGroup.ts @@ -6,7 +6,6 @@ import { createPenpotItem } from '.'; export const createPenpotGroup = ( file: PenpotFile, - // eslint-disable-next-line @typescript-eslint/no-unused-vars { type, children = [], ...rest }: GroupShape ) => { file.addGroup({ diff --git a/ui-src/converters/createPenpotImage.ts b/ui-src/converters/createPenpotImage.ts index 18d400d..bb038a6 100644 --- a/ui-src/converters/createPenpotImage.ts +++ b/ui-src/converters/createPenpotImage.ts @@ -2,7 +2,6 @@ import { PenpotFile } from '@ui/lib/penpot'; import { IMAGE_TYPE } from '@ui/lib/types/image/imageAttributes'; import { ImageShape } from '@ui/lib/types/image/imageShape'; -// eslint-disable-next-line @typescript-eslint/no-unused-vars export const createPenpotImage = (file: PenpotFile, { type, ...rest }: ImageShape) => { file.createImage({ type: IMAGE_TYPE, diff --git a/ui-src/converters/createPenpotRectangle.ts b/ui-src/converters/createPenpotRectangle.ts index 63f9793..c84e418 100644 --- a/ui-src/converters/createPenpotRectangle.ts +++ b/ui-src/converters/createPenpotRectangle.ts @@ -3,7 +3,6 @@ import { RECT_TYPE } from '@ui/lib/types/rect/rectAttributes'; import { RectShape } from '@ui/lib/types/rect/rectShape'; import { translateFillGradients } from '@ui/translators'; -// eslint-disable-next-line @typescript-eslint/no-unused-vars export const createPenpotRectangle = (file: PenpotFile, { type, fills, ...rest }: RectShape) => { file.createRect({ type: RECT_TYPE, diff --git a/ui-src/converters/createPenpotText.ts b/ui-src/converters/createPenpotText.ts index 11f11d9..568e9ec 100644 --- a/ui-src/converters/createPenpotText.ts +++ b/ui-src/converters/createPenpotText.ts @@ -2,11 +2,7 @@ import { PenpotFile } from '@ui/lib/penpot'; import { TEXT_TYPE } from '@ui/lib/types/text/textAttributes'; import { TextShape } from '@ui/lib/types/text/textShape'; -export const createPenpotText = ( - file: PenpotFile, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - { type, ...rest }: TextShape -) => { +export const createPenpotText = (file: PenpotFile, { type, ...rest }: TextShape) => { file.createText({ type: TEXT_TYPE, ...rest diff --git a/ui-src/lib/penpot.d.ts b/ui-src/lib/penpot.d.ts index d3f2725..bf0fbc7 100644 --- a/ui-src/lib/penpot.d.ts +++ b/ui-src/lib/penpot.d.ts @@ -36,8 +36,7 @@ export interface PenpotFile { // lookupShape(shapeId: string): void; // updateObject(id: string, object: any): void; // deleteObject(id: string): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - asMap(): any; + asMap(): unknown; export(): void; }