Skip to content

Commit

Permalink
Address some oxlint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Dec 13, 2023
1 parent 95b68b8 commit 73f55e5
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/animation/src/types/propTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const GeneralAnimationPropTypes = {

export const AnimationProps = {
id: PropTypes.string.isRequired,
type: PropTypes.oneOf([...Object.values(AnimationType)]),
type: PropTypes.oneOf(Object.values(AnimationType)),
targets: PropTypes.arrayOf(PropTypes.string),
...GeneralAnimationPropTypes,
};
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const LightTheme = {
},
};

const shortenedOptions = [...basicDropDownOptions.slice(0, 3)];
const shortenedOptions = basicDropDownOptions.slice(0, 3);

export const ShortMenu = {
render: function Render({ onMenuItemClick, ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const getInitial = (
(payload: Pick<HelpCenterState, 'readTips'>) =>
(state: HelpCenterState) => ({
readTips: {
...(payload?.readTips ?? {}),
...payload?.readTips,
...state.readTips,
},
isHydrated: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Cue({ cue, videoTime, height }) {
return (
<CueWrapper $height={height}>
<Section>
{[...html.childNodes].map((node) => {
{html.childNodes.map((node) => {
if (node.target === 'timestamp') {
return null;
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/story-editor/src/components/canvas/test/_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function TestFrameElement({
selectedElementIds: [],
...(inputStoryContext && inputStoryContext.state),
currentPage: {
...(inputStoryContext.state?.currentPage || {}),
...inputStoryContext.state?.currentPage,
elements: [
element,
...(inputStoryContext.state?.currentPage?.elements || []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function arrange(extraStylePresets, extraStateProps, extraStoryPresets) {
...extraStateProps,
story: {
globalStoryStyles: {
...{ colors: [], textStyles: [] },
colors: [],
textStyles: [],
...extraStylePresets,
},
currentStoryStyles: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function useDeleteColor({ onEmpty = noop }) {
updateStory({
properties: {
globalStoryStyles: {
...(globalStoryStyles || {}),
...globalStoryStyles,
colors: updatedColors,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export const _default = {
{filters.map(({ value: toggleValue, ...rest }) => {
return (
<FilterToggle
{...rest}
key={toggleValue}
{...rest}
isToggled={toggleValue === value}
onClick={() => setValue(toggleValue)}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/story-editor/src/components/form/tags/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ function Input({
].map((tag) =>
tag === INPUT_KEY ? (
<TextInput
{...props}
key={INPUT_KEY}
{...props}
value={value}
onKeyDown={handleKeyDown}
onChange={handleChange}
Expand Down
9 changes: 6 additions & 3 deletions packages/story-editor/src/components/library/libraryPanes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,33 @@ function LibraryPanes() {
case MEDIA.id:
return showMediaPane ? (
<MediaPane
key={id}
css={mediaHighlights?.showEffect && styles.FLASH}
{...paneProps}
/>
) : null;
case MEDIA3P.id:
return (
<Media3pPane
key={id}
{...paneProps}
css={media3pHighlights?.showEffect && styles.FLASH}
/>
);
case SHAPES.id:
return <ShapesPane {...paneProps} />;
return <ShapesPane key={id} {...paneProps} />;
case TEXT.id:
return (
<TextPane
key={id}
css={textHighlights?.showEffect && styles.FLASH}
{...paneProps}
/>
);
case PAGE_TEMPLATES.id:
return <PageTemplatesPane {...paneProps} />;
return <PageTemplatesPane key={id} {...paneProps} />;
case SHOPPING.id:
return <ShoppingPane {...paneProps} />;
return <ShoppingPane key={id} {...paneProps} />;
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ describe('TextPane', () => {
selectedElements: [],
story: {
globalStoryStyles: {
...{ colors: [], textStyles: [] },
colors: [],
textStyles: [],
},
currentStoryStyles: {
colors: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ function arrange(extraStylePresets, extraStateProps) {
...extraStateProps,
story: {
globalStoryStyles: {
...{ colors: [], textStyles: [] },
colors: [],
textStyles: [],
...extraStylePresets,
},
currentStoryStyles: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ function Wrapper({ children }) {
],
story: {
globalStoryStyles: {
...{ colors: [], textStyles: [] },
colors: [],
textStyles: [],
},
currentStoryStyles: {
colors: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ function Wrapper({ selectedElements, children }) {
selectedElements: selectedElements,
story: {
globalStoryStyles: {
...{ colors: [], textStyles: [] },
colors: [],
textStyles: [],
},
currentStoryStyles: {
colors: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function applyHiddenPadding(element) {
return element?.padding?.hasHiddenPadding
? element.padding
: {
...(element.padding ?? {}),
...element.padding,
hasHiddenPadding: true,
...['vertical', 'horizontal'].reduce((padding, axis) => {
padding[axis] =
Expand All @@ -51,7 +51,7 @@ export function applyHiddenPadding(element) {
export function removeHiddenPadding(element) {
return element?.padding?.hasHiddenPadding
? {
...(element.padding ?? {}),
...element.padding,
hasHiddenPadding: false,
...['vertical', 'horizontal'].reduce((padding, axis) => {
padding[axis] =
Expand Down
16 changes: 7 additions & 9 deletions webpack.config.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ function getConfig(group, { coverage = false } = {}) {
output: undefined,
mode: 'development',
devtool: 'inline-source-map',
plugins: [
// DependencyExtractionWebpackPlugin and HtmlWebpackPlugin are not needed for tests and
// otherwise has some failures.
...webpackConfig.plugins.filter(
(plugin) =>
!(plugin instanceof DependencyExtractionWebpackPlugin) &&
!(plugin instanceof HtmlWebpackPlugin)
),
],
// DependencyExtractionWebpackPlugin and HtmlWebpackPlugin are not needed for tests and
// otherwise has some failures.
plugins: webpackConfig.plugins.filter(
(plugin) =>
!(plugin instanceof DependencyExtractionWebpackPlugin) &&
!(plugin instanceof HtmlWebpackPlugin)
),
}))[0];
if (coverage) {
config.module.rules.push({
Expand Down

0 comments on commit 73f55e5

Please sign in to comment.