Skip to content

Commit

Permalink
Chore: Some code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Apr 11, 2024
1 parent 7af147f commit c912af1
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 176 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/.github export-ignore
/Resources/Private/Editor export-ignore
/.editorconfig export-ignore
/.eslintrc export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.nvmrc export-ignore
/.prettierignore export-ignore
/.prettierrc export-ignore
/build.mjs export-ignore
/CODE_OF_CONDUCT export-ignore
/eslint.config.js export-ignore
/Makefile export-ignore
/package.json export-ignore
/pnpm-lock.yaml export-ignore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-ignore
import React, { useEffect, useState } from "react";
import React from "react";
import * as stylex from "@stylexjs/stylex";
import { fonts } from "../Tokens.stylex";

Expand Down
8 changes: 4 additions & 4 deletions Resources/Private/Editor/ColorPicker/Components/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-ignore
import React, { useEffect, useState } from "react";
import React from "react";
import { HexColorPicker, HexColorInput } from "react-colorful";
import { onHexChange, setLuminance, setLightness, OptionPreview, RangeSlider } from "./index";
import { IconButton, SelectBox } from "@neos-project/react-ui-components";
Expand Down Expand Up @@ -165,7 +165,7 @@ export default function Panel({
/>
)}

{(Boolean(collapsed) ? Boolean(showHexInput) : true) && (
{(collapsed ? Boolean(showHexInput) : true) && (
<div {...stylex.props(styles.elementRow)}>
{Boolean(collapsed) || (
<div {...stylex.props(styles.colorPreview(state?.oklch), highlight && styles.highlight)} />
Expand All @@ -183,7 +183,7 @@ export default function Panel({
/>
)}

{!Boolean(collapsed) && Boolean(allowEmpty) && (
{!collapsed && Boolean(allowEmpty) && (
<IconButton
style="light"
icon="times"
Expand All @@ -196,7 +196,7 @@ export default function Panel({
</div>
)}

{Boolean(!!presetOptions) && (
{Boolean(presetOptions) && (
<SelectBox
options={presetOptions}
value={state?.hex}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const styles = stylex.create({
cursor: "grab",
height: 20,
width: 20,
border: "none",
borderWidth: 0,
borderRadius: sizes.borderRadius,
transitionProperty: "transform, background-color",
transitionTimingFunction: transitions.timing,
Expand All @@ -91,7 +91,7 @@ const styles = stylex.create({
cursor: "grab",
height: 20,
width: 20,
border: "none",
borderWidth: 0,
borderRadius: sizes.borderRadius,
transitionProperty: "transform, background-color",
transitionTimingFunction: transitions.timing,
Expand Down
6 changes: 3 additions & 3 deletions Resources/Private/Editor/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const styles = stylex.create({
display: "flex",
alignItems: "center",
justifyContent: "stretch",
border: "none",
borderWidth: 0,
padding: 0,
minHeight: sizes.goldenUnit,
borderRadius: sizes.borderRadius,
Expand All @@ -64,7 +64,7 @@ const styles = stylex.create({
backgroundColor: colors.contrastNeutral,
},
popoverButtonPreview: (color, luminance) => ({
flex: 1,
flex: "1",
display: "flex",
alignItems: "center",
justifyContent: "flex-start",
Expand Down Expand Up @@ -157,7 +157,7 @@ function Editor(props) {

return (
<div {...stylex.props(styles.wrapper, disabled && styles.disabled, enableCollapsed && styles.noGap)}>
{Boolean(enableCollapsed) ? (
{enableCollapsed ? (
<>
<button
{...stylex.props(styles.popoverButton, highlight && styles.highlight)}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Plugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.x11g6tue:not(#\#){background:none}
.x1hgx17m:not(#\#){background:var(--xm2tcaw)}
.x1wty727:not(#\#){border:0}
.x1gs6z28:not(#\#){border:none}
.xdneb0g:not(#\#){margin:calc(var(--x12ft4ps) * -1) calc(var(--xdcwdaz) * -1)}
.x1717udv:not(#\#){padding:0}
.x1dskcqz:not(#\#){padding:5px var(--x1xhd60u)}
Expand All @@ -15,6 +14,7 @@
.x2u8bby:not(#\#):not(#\#){border-radius:0}
.xorixrz:not(#\#):not(#\#){border-radius:100%}
.xjohyra:not(#\#):not(#\#){border-radius:var(--x1th158f)}
.xc342km:not(#\#):not(#\#){border-width:0}
.x98rzlu:not(#\#):not(#\#){flex:1}
.xxhr3t:not(#\#):not(#\#){gap:0}
.x188dswm:not(#\#):not(#\#){gap:var(--xdcwdaz)}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Plugin.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Resources/Public/Plugin.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const options = {
],
};

// eslint-disable-next-line no-undef
if (process.argv.includes("--watch")) {
esbuild.context(options).then((ctx) => ctx.watch());
} else {
Expand Down
24 changes: 24 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ["Resources/Public/*"],
},
{
files: ["**/*.{js,jsx,ts,tsx,mjs,mts}"],
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "React",
},
],
},
},
);
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
"watch": "node build.mjs --watch"
},
"devDependencies": {
"@neos-project/neos-ui-extensibility": "~8.3.6",
"@neos-project/react-ui-components": "^8.3.6",
"@neos-project/neos-ui-extensibility": "~8.3.7",
"@neos-project/react-ui-components": "^8.3.7",
"@stylexjs/esbuild-plugin": "^0.5.1",
"@stylexjs/eslint-plugin": "^0.5.1",
"@stylexjs/stylex": "^0.5.1",
"@types/nearest-color": "^0.4.1",
"color-name-list": "^10.20.2",
"colorjs.io": "^0.5.0",
"esbuild": "^0.20.2",
"eslint": "^8.57.0",
"eslint": "^9.0.0",
"nearest-color": "^0.4.4",
"onchange": "^7.1.0",
"prettier": "^3.2.5",
"react-colorful": "^5.6.1"
"react-colorful": "^5.6.1",
"typescript-eslint": "^7.6.0"
}
}
Loading

0 comments on commit c912af1

Please sign in to comment.