Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint(v6): fix eslint error #8726

Closed
wants to merge 189 commits into from
Closed

Conversation

robothot
Copy link
Contributor

@robothot robothot commented Feb 22, 2023

Motivation

Description

fix eslint error,

#8476

Changes

Gist

In Action

Copy link
Contributor

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this
Please double check changes and run the test suite


const onComplete = callbacks.onComplete || empty
const onChange = callbacks.onChange || empty
const _this = this;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -6,7 +6,7 @@
* @return {Object} CSS rules of this document
*/
export function getCSSRules(doc) {
let styles = doc.getElementsByTagName('style'),
const styles = doc.getElementsByTagName('style'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is surely an error
you can move the definition of i to the loop and remove len if is used only once

@@ -4,7 +4,7 @@ import { parseUnit } from '../util/misc/svgParsing';
import { parseTransformAttribute } from './parseTransformAttribute';

export function normalizeValue(attr, value, parentAttributes, fontSize) {
let isArray = Array.isArray(value),
const isArray = Array.isArray(value),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is this, let parsed

@@ -45,7 +45,7 @@ export function normalizeValue(attr, value, parentAttributes, fontSize) {
} else if (attr === 'paintFirst') {
const fillIndex = value.indexOf('fill');
const strokeIndex = value.indexOf('stroke');
var value = 'fill';
const value = 'fill';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is this

@@ -17,7 +17,7 @@ export function parsePointsAttribute(points) {
points = points.replace(/,/g, ' ').trim();

points = points.split(/\s+/);
let parsedPoints = [],
const parsedPoints = [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@@ -13,7 +13,7 @@ import type { ValueAnimation } from '../../util/animation/ValueAnimation';
import { TextStyleDeclaration } from '../Text/StyledText';

// extend this regex to support non english languages
const reNonWord = /[ \n\.,;!\?\-]/;
const reNonWord = /[ \n\\.,;!?-]/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong I think.
\. === '.'
\\. === '' + any char?

Comment on lines +1 to +5
src/mixins/eraser_brush.mixin.ts
src/util/lang_class.ts
src/filters/Resize.ts
src/parkinglot/canvas_animation.mixin.ts
src/parser/applyViewboxTransform.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
src/mixins/eraser_brush.mixin.ts
src/util/lang_class.ts
src/filters/Resize.ts
src/parkinglot/canvas_animation.mixin.ts
src/parser/applyViewboxTransform.ts
src/mixins/eraser_brush.mixin.ts
src/util/lang_class.ts
src/parkinglot/canvas_animation.mixin.ts

@ShaMan123
Copy link
Contributor

And I prefer you rebase to master so tests can run

@robothot robothot changed the title lint(v6): fix eslint error lint(v6): fix eslint error WIP Feb 22, 2023
@robothot robothot changed the base branch from clip-brush to master February 22, 2023 12:53
@robothot robothot closed this Feb 22, 2023
@robothot robothot changed the title lint(v6): fix eslint error WIP lint(v6): fix eslint error Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants