From e0f13ab7c98774a2c7197679ac5cdff4209faa1f Mon Sep 17 00:00:00 2001 From: Alex Ruddick Date: Thu, 2 Nov 2023 19:58:24 -0500 Subject: [PATCH] prettier -w . --- .stylelintrc | 17 ++++++--------- docs/index.html | 2 +- src/backgroundWindow/background.html | 2 +- .../Drawing/DrawingContent/DrawingContent.js | 6 ++---- .../Drawing/DrawingSidebar/DrawingSidebar.js | 5 ++--- .../DrawingSidebar/MultiplyCanvasOptions.js | 8 ++----- src/components/Drawing/modes/circle.mode.js | 5 ++--- src/components/Drawing/modes/square.mode.js | 10 ++++----- .../Drawing/modes/straightLine.mode.js | 5 ++--- src/components/EfxSidebar/EfxSidebar.js | 16 ++++---------- .../GifmakerContent/GifmakerSidebar.js | 9 ++------ .../OptionsSidebar/OptionsSidebar.js | 18 ++++------------ src/components/PlotSidebar/PlotSidebar.js | 7 ++----- src/filters/Distort.js | 16 ++++---------- src/index.html | 2 +- src/utils/__tests__/coordUtils.test.js | 18 +++++++++------- src/utils/__tests__/fillLines.test.js | 21 ++----------------- src/utils/lineSortUtils.js | 5 ++--- 18 files changed, 53 insertions(+), 119 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 934b3de6..58a01925 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,12 +1,7 @@ { - "plugins": [ - "stylelint-order" - ], - "rules": { - "order/order": [ - "custom-properties", - "declarations" - ], - "order/properties-alphabetical-order": true - } -} \ No newline at end of file + "plugins": ["stylelint-order"], + "rules": { + "order/order": ["custom-properties", "declarations"], + "order/properties-alphabetical-order": true + } +} diff --git a/docs/index.html b/docs/index.html index da98fc9f..0d8acccc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ - + diff --git a/src/backgroundWindow/background.html b/src/backgroundWindow/background.html index 83cbf0a4..792f9365 100644 --- a/src/backgroundWindow/background.html +++ b/src/backgroundWindow/background.html @@ -1,4 +1,4 @@ - + diff --git a/src/components/Drawing/DrawingContent/DrawingContent.js b/src/components/Drawing/DrawingContent/DrawingContent.js index 683446c0..fdade721 100644 --- a/src/components/Drawing/DrawingContent/DrawingContent.js +++ b/src/components/Drawing/DrawingContent/DrawingContent.js @@ -229,10 +229,8 @@ export class DrawingContent extends React.Component { }; getDrawingEndProcessor = () => { - const { - formatTempCoords, - formatFinalCoords - } = this.getActiveModeHandlers(); + const { formatTempCoords, formatFinalCoords } = + this.getActiveModeHandlers(); if (formatFinalCoords != null) { return formatFinalCoords; diff --git a/src/components/Drawing/DrawingSidebar/DrawingSidebar.js b/src/components/Drawing/DrawingSidebar/DrawingSidebar.js index db073c40..77e5efa6 100644 --- a/src/components/Drawing/DrawingSidebar/DrawingSidebar.js +++ b/src/components/Drawing/DrawingSidebar/DrawingSidebar.js @@ -139,9 +139,8 @@ class DrawingSidebar extends React.Component { > {mainMode === 'draw' && _.keys(DRAWING_MODES).map((modeKey) => { - const { displayName, emoji } = DRAWING_MODES[ - modeKey - ]; + const { displayName, emoji } = + DRAWING_MODES[modeKey]; return ( { - const { - multiplyCanvasOptions, - globalHeight, - globalWidth, - dispatch - } = props; + const { multiplyCanvasOptions, globalHeight, globalWidth, dispatch } = + props; const { x, y } = multiplyCanvasOptions; const finalHeight = globalHeight * y; diff --git a/src/components/Drawing/modes/circle.mode.js b/src/components/Drawing/modes/circle.mode.js index c3c8fad9..e69d1e17 100644 --- a/src/components/Drawing/modes/circle.mode.js +++ b/src/components/Drawing/modes/circle.mode.js @@ -14,9 +14,8 @@ const makeCircle = (centerX, centerY, radius, pointsOnCircle = 50) => { }; const formatTempCoords = (tempCoords, { pointsOnCircle }) => { - const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords( - tempCoords - ); + const [startCoords, endCoords] = + getFirstAndLastCoordsFromTempCoords(tempCoords); const [x1, y1] = startCoords; const [x2, y2] = endCoords; diff --git a/src/components/Drawing/modes/square.mode.js b/src/components/Drawing/modes/square.mode.js index 31decad3..d515ae56 100644 --- a/src/components/Drawing/modes/square.mode.js +++ b/src/components/Drawing/modes/square.mode.js @@ -3,9 +3,8 @@ import { allPointsBetweenTwoCoords } from '../../../utils/coordUtils'; import { getFirstAndLastCoordsFromTempCoords } from '../../../utils/drawingUtils'; const formatTempCoords = (coords) => { - const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords( - coords - ); + const [startCoords, endCoords] = + getFirstAndLastCoordsFromTempCoords(coords); const [startX, startY] = startCoords; const [endX, endY] = endCoords; const fourCorners = _.clone([ @@ -21,9 +20,8 @@ const formatTempCoords = (coords) => { const formatFinalCoords = (coords, options) => { const { pointsOnEachLine } = options; - const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords( - coords - ); + const [startCoords, endCoords] = + getFirstAndLastCoordsFromTempCoords(coords); const [startX, startY] = startCoords; const [endX, endY] = endCoords; diff --git a/src/components/Drawing/modes/straightLine.mode.js b/src/components/Drawing/modes/straightLine.mode.js index ffc4528d..cf2b2c8d 100644 --- a/src/components/Drawing/modes/straightLine.mode.js +++ b/src/components/Drawing/modes/straightLine.mode.js @@ -2,9 +2,8 @@ import { allPointsBetweenTwoCoords } from '../../../utils/coordUtils'; import { getFirstAndLastCoordsFromTempCoords } from '../../../utils/drawingUtils'; const formatTempCoords = (tempCoords, { pointsOnEachLine }) => { - const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords( - tempCoords - ); + const [startCoords, endCoords] = + getFirstAndLastCoordsFromTempCoords(tempCoords); const allPoints = allPointsBetweenTwoCoords(startCoords, endCoords, { maxPointCount: pointsOnEachLine diff --git a/src/components/EfxSidebar/EfxSidebar.js b/src/components/EfxSidebar/EfxSidebar.js index 7b29e068..ca9dd79c 100644 --- a/src/components/EfxSidebar/EfxSidebar.js +++ b/src/components/EfxSidebar/EfxSidebar.js @@ -185,12 +185,8 @@ class EfxSidebar extends React.Component { }; processEfxLinesForLayer = (layerID) => { - const { - allOriginalLines, - globalSettings, - allLayers, - dispatch - } = this.props; + const { allOriginalLines, globalSettings, allLayers, dispatch } = + this.props; const { filters } = allLayers.find((l) => l.id === layerID); const linesForThisLayer = allOriginalLines[layerID]; @@ -281,12 +277,8 @@ class EfxSidebar extends React.Component { dispatch } = this.props; - const { - savingPreset, - savePresetName, - presets, - loadingMessage - } = this.state; + const { savingPreset, savePresetName, presets, loadingMessage } = + this.state; return ( diff --git a/src/components/GifmakerContent/GifmakerSidebar.js b/src/components/GifmakerContent/GifmakerSidebar.js index e64ba890..56bbc8a7 100644 --- a/src/components/GifmakerContent/GifmakerSidebar.js +++ b/src/components/GifmakerContent/GifmakerSidebar.js @@ -81,13 +81,8 @@ class GifmakerSidebar extends React.Component { }; render() { - const { - loading, - frames, - gifFrameDelay, - gifBackgroundColor, - dispatch - } = this.props; + const { loading, frames, gifFrameDelay, gifBackgroundColor, dispatch } = + this.props; if (loading) { return LOADING ; diff --git a/src/components/OptionsSidebar/OptionsSidebar.js b/src/components/OptionsSidebar/OptionsSidebar.js index 9b2e8305..c872bfc9 100644 --- a/src/components/OptionsSidebar/OptionsSidebar.js +++ b/src/components/OptionsSidebar/OptionsSidebar.js @@ -61,13 +61,8 @@ class OptionsSidebar extends React.Component { }; isDirty = () => { - const { - height, - width, - pointShowRadius, - pointShowColor, - shiftToDraw - } = this.props; + const { height, width, pointShowRadius, pointShowColor, shiftToDraw } = + this.props; const { tempHeight, tempWidth, @@ -92,13 +87,8 @@ class OptionsSidebar extends React.Component { }; render() { - const { - height, - width, - pointShowRadius, - pointShowColor, - shiftToDraw - } = this.props; + const { height, width, pointShowRadius, pointShowColor, shiftToDraw } = + this.props; const { tempHeight, tempWidth, diff --git a/src/components/PlotSidebar/PlotSidebar.js b/src/components/PlotSidebar/PlotSidebar.js index e9dd938a..a65d90de 100644 --- a/src/components/PlotSidebar/PlotSidebar.js +++ b/src/components/PlotSidebar/PlotSidebar.js @@ -113,11 +113,8 @@ class PlotSidebar extends React.Component { dispatch(setCurrentPlotPercentage(0)); const lineDrawCallback = (response) => { - const { - currentLineId, - currentLineCount, - totalLineCount - } = response; + const { currentLineId, currentLineCount, totalLineCount } = + response; dispatch(setCurrentLineId(currentLineId)); this.setCurrentLineIndex(currentLineCount); diff --git a/src/filters/Distort.js b/src/filters/Distort.js index 8a6b3432..499f4bcc 100644 --- a/src/filters/Distort.js +++ b/src/filters/Distort.js @@ -6,12 +6,8 @@ const filterName = 'distort'; const displayName = 'dist0rt'; const DistortComponent = ({ filterSettings, updateOptions }) => { - const { - percentToAffect, - distortionAmount, - horizontal, - vertical - } = filterSettings; + const { percentToAffect, distortionAmount, horizontal, vertical } = + filterSettings; return ( <> @@ -66,12 +62,8 @@ const DistortComponent = ({ filterSettings, updateOptions }) => { export const DistortFilter = ({ filterSettings, pointArrays }) => { if (!filterSettings || !filterSettings.enabled) return pointArrays; - const { - percentToAffect, - distortionAmount, - horizontal, - vertical - } = filterSettings; + const { percentToAffect, distortionAmount, horizontal, vertical } = + filterSettings; const yValueMap = {}; const xValueMap = {}; diff --git a/src/index.html b/src/index.html index 793c69df..43e42774 100644 --- a/src/index.html +++ b/src/index.html @@ -1,4 +1,4 @@ - + diff --git a/src/utils/__tests__/coordUtils.test.js b/src/utils/__tests__/coordUtils.test.js index 3779b893..388ea3b8 100644 --- a/src/utils/__tests__/coordUtils.test.js +++ b/src/utils/__tests__/coordUtils.test.js @@ -167,20 +167,22 @@ describe('isPointOnLineBetweenTwoCoords()', () => { it('should return true when point is on line', () => { const startCoords = [0, 0]; const endCoords = [100, 100]; - const result = isPointOnLineBetweenTwoCoords(startCoords, endCoords, [ - 10, - 10 - ]); + const result = isPointOnLineBetweenTwoCoords( + startCoords, + endCoords, + [10, 10] + ); expect(result).toBe(true); }); it('should return false when point is not on line', () => { const startCoords = [0, 0]; const endCoords = [100, 100]; - const result = isPointOnLineBetweenTwoCoords(startCoords, endCoords, [ - 10, - 50 - ]); + const result = isPointOnLineBetweenTwoCoords( + startCoords, + endCoords, + [10, 50] + ); expect(result).toBe(false); }); }); diff --git a/src/utils/__tests__/fillLines.test.js b/src/utils/__tests__/fillLines.test.js index c8ee5e3b..983bb2ef 100644 --- a/src/utils/__tests__/fillLines.test.js +++ b/src/utils/__tests__/fillLines.test.js @@ -142,25 +142,8 @@ const testLinesAtAngle = (context, angle) => { }; const ANGLES = [ - 0, - 10, - 20, - 30, - 40, - 50, - 60, - 70, - 80, - 90, - 100, - 110, - 120, - 130, - 140, - 150, - 160, - 170, - 180 + 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, + 170, 180 ]; describe('Draw Lines At Angle', () => { diff --git a/src/utils/lineSortUtils.js b/src/utils/lineSortUtils.js index dcbfdce9..5202fc18 100644 --- a/src/utils/lineSortUtils.js +++ b/src/utils/lineSortUtils.js @@ -15,9 +15,8 @@ export const findNearestLine = (currentLine, remainingLines) => { ).end; remainingLines.forEach(({ id, pointArrayContainer }) => { - const { start, end } = getStartAndEndPointsOfCoords( - pointArrayContainer - ); + const { start, end } = + getStartAndEndPointsOfCoords(pointArrayContainer); const startDistance = distanceBetweenTwoCoords(currentLineEnd, start); const endDistance = distanceBetweenTwoCoords(currentLineEnd, end);