chore: use prettier instead of clang-format (#7014)

* chore: add and configure prettier

* chore: remove clang-format

* chore: remove clang-format config

* chore: lint additional ts files

* chore: fix lint errors in blocks

* chore: add prettier-ignore where needed

* chore: ignore js blocks when formatting

* chore: fix playground html syntax

* chore: fix yaml spacing from merge

* chore: convert text blocks to use arrow functions

* chore: format everything with prettier

* chore: fix lint unused imports in blocks
This commit is contained in:
Maribeth Bottorff
2023-05-10 16:01:39 -07:00
committed by GitHub
parent af991f5e1b
commit 88ff901a72
425 changed files with 29170 additions and 21169 deletions

View File

@@ -16,7 +16,6 @@ import {Svg} from '../../utils/svg.js';
import type {ConstantProvider} from './constants.js';
import type {IPathObject} from './i_path_object.js';
/**
* An object that handles creating and setting each of the SVG elements
* used by the renderer.
@@ -29,13 +28,13 @@ export class PathObject implements IPathObject {
* Holds the cursors svg element when the cursor is attached to the block.
* This is null if there is no cursor on the block.
*/
cursorSvg: SVGElement|null = null;
cursorSvg: SVGElement | null = null;
/**
* Holds the markers svg element when the marker is attached to the block.
* This is null if there is no marker on the block.
*/
markerSvg: SVGElement|null = null;
markerSvg: SVGElement | null = null;
constants: ConstantProvider;
style: BlockStyle;
@@ -46,14 +45,20 @@ export class PathObject implements IPathObject {
* @param constants The renderer's constants.
*/
constructor(
root: SVGElement, style: BlockStyle, constants: ConstantProvider) {
root: SVGElement,
style: BlockStyle,
constants: ConstantProvider
) {
this.constants = constants;
this.style = style;
this.svgRoot = root;
/** The primary path of the block. */
this.svgPath =
dom.createSvgElement(Svg.PATH, {'class': 'blocklyPath'}, this.svgRoot);
this.svgPath = dom.createSvgElement(
Svg.PATH,
{'class': 'blocklyPath'},
this.svgRoot
);
}
/**
@@ -159,7 +164,9 @@ export class PathObject implements IPathObject {
updateHighlighted(enable: boolean) {
if (enable) {
this.svgPath.setAttribute(
'filter', 'url(#' + this.constants.embossFilterId + ')');
'filter',
'url(#' + this.constants.embossFilterId + ')'
);
} else {
this.svgPath.setAttribute('filter', 'none');
}
@@ -186,7 +193,9 @@ export class PathObject implements IPathObject {
this.setClass_('blocklyDisabled', disabled);
if (disabled) {
this.svgPath.setAttribute(
'fill', 'url(#' + this.constants.disabledPatternId + ')');
'fill',
'url(#' + this.constants.disabledPatternId + ')'
);
}
}