Skip to content

Commit

Permalink
lint clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Jul 10, 2024
1 parent ca14496 commit 1ef7861
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
browser: [ChromeHeadless, FirefoxHeadless]
browser: [chromium, firefox]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
Expand All @@ -27,19 +27,14 @@ jobs:
if: matrix.os == 'macOS-latest'
run: brew update

- name: Install Chrome (macOS)
if: matrix.os == 'macOS-latest' && matrix.browser == 'ChromeHeadless'
run: brew install --cask google-chrome

- name: Install Firefox (macOS)
if: matrix.os == 'macOS-latest' && matrix.browser == 'FirefoxHeadless'
run: brew install --cask firefox

- name: Install Dependencies
run: yarn bootstrap

- name: Install Playwright Browsers
run: yarn playwright install --with-deps

- name: Run Tests
run: yarn test
run: yarn test --browser.name=$BROWSER --browser.headless
env:
BROWSER: ${{ matrix.browser }}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"build:pick": "cherry-pick --cwd=lib --input-dir=../src --cjs-dir=cjs --esm-dir=esm",
"build:popper": "rollup src/popper.ts --file lib/cjs/popper.js --format cjs --name popper --plugin @rollup/plugin-node-resolve",
"deploy-docs": "yarn --cwd www deploy",
"lint": "eslint www/*.js www/src src test *.js --ext .js,.ts,.tsx",
"lint": "eslint www/*.js www/src src test *.ts --ext .js,.ts,.tsx",
"prepublishOnly": "yarn build",
"release": "rollout",
"start": "yarn --cwd www start",
Expand Down
32 changes: 15 additions & 17 deletions src/NavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,21 @@ export function useNavItem({
return [props, { isActive }] as const;
}

const NavItem: DynamicRefForwardingComponent<
typeof Button,
NavItemProps
> = React.forwardRef<HTMLElement, NavItemProps>(
({ as: Component = Button, active, eventKey, ...options }, ref) => {
const [props, meta] = useNavItem({
key: makeEventKey(eventKey, options.href),
active,
...options,
});

// @ts-ignore
props[dataAttr('active')] = meta.isActive;

return <Component {...options} {...props} ref={ref} />;
},
);
const NavItem: DynamicRefForwardingComponent<typeof Button, NavItemProps> =
React.forwardRef<HTMLElement, NavItemProps>(
({ as: Component = Button, active, eventKey, ...options }, ref) => {
const [props, meta] = useNavItem({
key: makeEventKey(eventKey, options.href),
active,
...options,
});

// @ts-ignore
props[dataAttr('active')] = meta.isActive;

return <Component {...options} {...props} ref={ref} />;
},
);

NavItem.displayName = 'NavItem';

Expand Down

0 comments on commit 1ef7861

Please sign in to comment.