Skip to content

Commit

Permalink
remove eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-javascript committed Dec 19, 2024
1 parent 1e3606a commit e693901
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/hooks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useContext} from 'react';
import {useContext} from 'react';
import {ApiContext, StateContext, ForceUpdateContext} from './context.js';
export const useApi = function useApi() {
return useContext(ApiContext);
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/moreButtonPlugin/button/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ export default function Api(components, setOpen) {
this._components.TabFactory.bind(undefined, (ins) => ({
tabPropsManager: (props) => {
const originalProps = this._components.tabPropsManager(ins, props);

const {
'aria-controls': ariaControls,
'aria-expanded': ariaExpanded,
'aria-selected': ariaSelected,
id,
'aria-controls': ariaControls, // eslint-disable-line no-unused-vars
'aria-expanded': ariaExpanded, // eslint-disable-line no-unused-vars
'aria-selected': ariaSelected, // eslint-disable-line no-unused-vars
id, // eslint-disable-line no-unused-vars
...rest
} = originalProps;
if (rest.role) {
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/moreButtonPlugin/setComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function setComponents(deps, ctx, components) {
setComponents.setMoreButtonPlugin(ctx, components, ShowMoreTabs, setComponents.ShowMoreButton, memo);
setComponents.setTablistOverflow(components);
}
export const ShowMoreButton = (setComponents.ShowMoreButton = function (deps, props) {
export const ShowMoreButton = (setComponents.ShowMoreButton = function ShowMoreButton(deps, props) {
const {
ShowMoreTabs,
components: {useForceUpdate, useRootState},
Expand All @@ -17,7 +17,7 @@ export const ShowMoreButton = (setComponents.ShowMoreButton = function (deps, pr
const {openTabIDs, selectedTabID} = useRootState();
return (
<ShowMoreTabs {...props} ctx={deps.ctx} openTabIDs={openTabIDs} selectedTabID={selectedTabID}>
{props.children}
{props.children /* eslint-disable-line react/prop-types */}
</ShowMoreTabs>
);
});
Expand All @@ -38,10 +38,10 @@ export const setMoreButtonPlugin = (setComponents.setMoreButtonPlugin = function
export const setTablistOverflow = (setComponents.setTablistOverflow = function (components) {
if (!components.OriginalTablistOverflow) {
components.OriginalTablistOverflow = components.TablistOverflow;
components.TablistOverflow = function (props) {
components.TablistOverflow = function TablistOverflow(props) {
return (
<components.OriginalTablistOverflow {...props}>
{props.children}
{props.children /* eslint-disable-line react/prop-types */}
<components.MoreButtonPlugin />
</components.OriginalTablistOverflow>
);
Expand Down
2 changes: 1 addition & 1 deletion src/tab/memomizeTab.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {memo} from 'react';
import {memo} from 'react';
export default (TabComponent) =>
memo(TabComponent, (oldProps, newProps) => {
const {id, selectedTabID: oldActiveId} = oldProps,
Expand Down
2 changes: 1 addition & 1 deletion src/tab/tab.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const TabComponent = function TabComponent(deps, props) {
React.useContext(ForceUpdateContext);
const api = React.useContext(ApiContext);
const {tabPropsManager, tabInnerPropsManager, closeIconPropsManager} = deps(api);
const {id, selectedTabID} = props,
const {id, selectedTabID} = props, // eslint-disable-line no-unused-vars
TabInnerComponent = api.getOption('tabComponent'),
tabObj = api.getTab(id),
clkHandler = function (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/api/api.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Helper.setNoneEnumProps(_apiProps, {
},
getSetting: function (settingName) {
const st = this.optionsManager.setting;
if (st.hasOwnProperty(settingName)) {
if (Object.prototype.hasOwnProperty.call(st, settingName)) {
if (typeof st[settingName] === 'function') {
return st[settingName].apply(st, Array.prototype.slice.call(arguments, 1));
}
Expand Down

0 comments on commit e693901

Please sign in to comment.