Skip to content

Commit

Permalink
chore: fix eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wang1212 committed Oct 23, 2024
1 parent dbd86fb commit 54bb2b7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
11 changes: 6 additions & 5 deletions __tests__/demos/bugfix/1747.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Text, Path, Rect } from '@antv/g';
import { Canvas, Text, Path, Rect } from '@antv/g';

export async function test_pick(context) {
export async function test_pick(context: { canvas: Canvas }) {
const { canvas } = context;
await canvas.ready;

Expand All @@ -20,7 +20,8 @@ export async function test_pick(context) {
x: 300,
y: 300,
cursor: 'pointer',
// transform: 'rotate(45)',
transform: 'rotate(45)',
transformOrigin: 'center',
},
});
console.log(text.getBounds());
Expand All @@ -38,7 +39,7 @@ export async function test_pick(context) {
test(path, 'fill');

canvas.appendChild(text);
// canvas.appendChild(path);
canvas.appendChild(path);

const { x, y, width, height } = text.getBBox();
const rect = new Rect({
Expand All @@ -54,5 +55,5 @@ export async function test_pick(context) {
});
test(rect, 'stroke');

// canvas.appendChild(rect);
canvas.appendChild(rect);
}
2 changes: 1 addition & 1 deletion packages/g-lite/src/dom/Document.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isFunction } from '@antv/util';
import { runtime } from '../global-runtime';
import { BUILT_IN_PROPERTIES } from '../css';
import { Group, Text } from '../display-objects';
Expand All @@ -17,7 +18,6 @@ import type {
INode,
} from './interfaces';
import { Node } from './Node';
import { isFunction } from '@antv/util';

/**
* the entry of DOM tree
Expand Down
2 changes: 2 additions & 0 deletions packages/g-lite/src/dom/EventTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class EventTarget implements IEventTarget {
else if (options) ({ capture = false, once = false } = options);

if (capture) type += 'capture';
// eslint-disable-next-line @typescript-eslint/unbound-method
listener = isFunction(listener) ? listener : listener.handleEvent;

const context = isFunction(listener) ? undefined : listener;
Expand Down Expand Up @@ -91,6 +92,7 @@ export class EventTarget implements IEventTarget {

const capture = isBoolean(options) ? options : options?.capture;
if (capture) type += 'capture';
// eslint-disable-next-line @typescript-eslint/unbound-method
listener = isFunction(listener) ? listener : listener?.handleEvent;
const context = isFunction(listener) ? undefined : listener;

Expand Down
10 changes: 5 additions & 5 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import babel from '@rollup/plugin-babel';
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import replace from '@rollup/plugin-replace';
import strip from '@rollup/plugin-strip';
// import strip from '@rollup/plugin-strip';
import filesize from 'rollup-plugin-filesize';
import { visualizer } from 'rollup-plugin-visualizer';
// import { visualizer } from 'rollup-plugin-visualizer';
import { builtinModules } from 'module';
import process from 'node:process';
import path from 'node:path';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import path.
import { URL, fileURLToPath } from 'node:url';
import fse from 'fs-extra';
// import { URL, fileURLToPath } from 'node:url';
// import fse from 'fs-extra';
import babelConfig from './babel.config.mjs';

const WORKING_DIRECTORY = fileURLToPath(new URL('.', import.meta.url));
// const WORKING_DIRECTORY = fileURLToPath(new URL('.', import.meta.url));
const __DEV__ = String(process.env.NODE_ENV).trim() === 'development';
const EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.es6', '.es', '.mjs'];
const buildBanner = (pkg) => {
Expand Down

0 comments on commit 54bb2b7

Please sign in to comment.