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

Enforce no trailing spaces #95

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = {
plugins: ['@typescript-eslint'],
rules: {
quotes: ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }],
semi: ['error', 'always']
semi: ['error', 'always'],
'no-trailing-spaces': ['error']
},
overrides: [
{
Expand Down
12 changes: 6 additions & 6 deletions src/color/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {
HSLObject,
CMYKObject
} from '@types';
import {
toHEX,
hasProp,
round,
roundAll,
toHEXAll
import {
toHEX,
hasProp,
round,
roundAll,
toHEXAll
} from '#helpers';

export const CSS = {
Expand Down
2 changes: 1 addition & 1 deletion src/color/translators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const rybToRGB = (r: number, y: number, b: number): RGBObject => {

//---Hue RYB
export const hueRYB = (hue: number, toRYB: boolean): number => {

if (hue < 0) hue += 360;
if (hue > 360) hue -= 360;

Expand Down
14 changes: 7 additions & 7 deletions src/color/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const normalizeHue = (hue: number | string): number => {
break;
case 'deg':
case 'grad':
default:
default:
hue = value;
}
}
Expand All @@ -82,7 +82,7 @@ export const normalizeHue = (hue: number | string): number => {
}

return hue;
};
};

//---Normalize alpha
export const normalizeAlpha = (alpha: number | string | undefined | null): number => {
Expand All @@ -100,7 +100,7 @@ export const normalizeAlpha = (alpha: number | string | undefined | null): numbe
const harmony = (color: HSLObject, angles: number[], mode: Mix): HSLObject[] =>
angles.reduce(
(arr: HSLObject[], num: number): HSLObject[] =>
(
(
[
...arr,
{
Expand Down Expand Up @@ -158,7 +158,7 @@ const getColorModelFromObject = (color: Color): ColorModel => {
let model: ColorModel;
let invalid = false;
const props = getOrderedArrayString(Object.keys(color));

if(VALID_COLOR_OBJECTS[props]) {
model = VALID_COLOR_OBJECTS[props];
}
Expand All @@ -183,7 +183,7 @@ const getColorModelFromObject = (color: Color): ColorModel => {
if (hasInvalidHex && hasInvalidRegb) {
invalid = true;
}

if (!hasInvalidHex) {
model = ColorModel.HEX;
}
Expand Down Expand Up @@ -436,7 +436,7 @@ export const getColorMixture = (color: ColorInputWithoutCMYK, steps: number, sha
? translateColor.HSLA({ ...hslToRGB(hslColor.h, hslColor.s, hslColor.l), a: hslColor.a })
: translateColor.HSL(hslToRGB(hslColor.h, hslColor.s, hslColor.l));
});

}
};

Expand Down Expand Up @@ -623,7 +623,7 @@ export const colorMixer = {
mix = rybToRGB(ryb.r, ryb.y, ryb.b);
mix.a = ryb.a;
}

return {
r: round(mix.r, 2),
g: round(mix.g, 2),
Expand Down