Skip to content

Commit

Permalink
prettier -w .
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed Nov 3, 2023
1 parent d8a4533 commit 06174f9
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 125 deletions.
17 changes: 6 additions & 11 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"plugins": [
"stylelint-order"
],
"rules": {
"order/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true
}
}
"plugins": ["stylelint-order"],
"rules": {
"order/order": ["custom-properties", "declarations"],
"order/properties-alphabetical-order": true
}
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"jest-css-modules": "^2.1.0",
"jest-image-snapshot": "^4.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.4",
"prettier": "^3.0.3",
"progress-bar-webpack-plugin": "^2.1.0",
"raw-loader": "^4.0.1",
"rimraf": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/backgroundWindow/background.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
6 changes: 2 additions & 4 deletions src/components/Drawing/DrawingContent/DrawingContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/components/Drawing/DrawingSidebar/DrawingSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<EmojiButton
key={modeKey}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import PercentClicker from 'components/common/PercentClicker/PercentClicker';
import styles from './ShrinkCanvasOptions.styles.css';

const MultiplyCanvasOptions = (props) => {
const {
multiplyCanvasOptions,
globalHeight,
globalWidth,
dispatch
} = props;
const { multiplyCanvasOptions, globalHeight, globalWidth, dispatch } =
props;

const { x, y } = multiplyCanvasOptions;
const finalHeight = globalHeight * y;
Expand Down
5 changes: 2 additions & 3 deletions src/components/Drawing/modes/circle.mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions src/components/Drawing/modes/square.mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions src/components/Drawing/modes/straightLine.mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 4 additions & 12 deletions src/components/EfxSidebar/EfxSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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 (
<SidebarContainer>
Expand Down
9 changes: 2 additions & 7 deletions src/components/GifmakerContent/GifmakerSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SidebarContainer> LOADING </SidebarContainer>;
Expand Down
18 changes: 4 additions & 14 deletions src/components/OptionsSidebar/OptionsSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions src/components/PlotSidebar/PlotSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 4 additions & 12 deletions src/filters/Distort.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
Expand Down Expand Up @@ -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 = {};
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
18 changes: 10 additions & 8 deletions src/utils/__tests__/coordUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
21 changes: 2 additions & 19 deletions src/utils/__tests__/fillLines.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/utils/lineSortUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3681,7 +3681,7 @@ connect-history-api-fallback@^2.0.0:
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8"
integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==

"connect-slashes@github:techninja/connect-slashes#ignore-files":
connect-slashes@techninja/connect-slashes#ignore-files:
version "1.3.1"
resolved "https://codeload.github.com/techninja/connect-slashes/tar.gz/c3c37d4130b9ef5ed82bd21db2d4f749021ce299"

Expand Down Expand Up @@ -9081,10 +9081,10 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.0.4:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
prettier@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==

pretty-error@^4.0.0:
version "4.0.0"
Expand Down

0 comments on commit 06174f9

Please sign in to comment.