Skip to content

Commit

Permalink
build: fix eslint config and code issues (#423)
Browse files Browse the repository at this point in the history
build: add turbo env

fix: remove invalid eslint disable
  • Loading branch information
gsong authored Sep 16, 2024
1 parent d348384 commit 74e4d02
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ["adapter"],
extends: ["@aptos-labs/eslint-config-adapter"],
settings: {
next: {
rootDir: ["apps/*/"],
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-adapter-ant-design/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["adapter"],
extends: ["@aptos-labs/eslint-config-adapter"],
};
2 changes: 1 addition & 1 deletion packages/wallet-adapter-core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["adapter"],
extends: ["@aptos-labs/eslint-config-adapter"],
};
1 change: 0 additions & 1 deletion packages/wallet-adapter-core/src/error/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export class WalletError extends Error {
public error: any;

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
constructor(message?: string, error?: any) {
super(message);
this.error = error;
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-adapter-react/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["adapter"],
extends: ["@aptos-labs/eslint-config-adapter"],
};
13 changes: 5 additions & 8 deletions packages/wallet-adapter-react/src/components/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function createHeadlessComponent<
elementType: TElement,
props?:
| JSX.IntrinsicElements[TElement]
| ((displayName: string) => JSX.IntrinsicElements[TElement])
| ((displayName: string) => JSX.IntrinsicElements[TElement]),
) {
const component = forwardRef<
HTMLElementFromTag<TElement>,
Expand All @@ -38,7 +38,7 @@ export function createHeadlessComponent<
const Component = asChild ? Slot : elementType;

const { children: defaultChildren, ...resolvedProps } =
typeof props === "function" ? props(displayName) : props ?? {};
typeof props === "function" ? props(displayName) : (props ?? {});

return (
/**
Expand All @@ -52,12 +52,9 @@ export function createHeadlessComponent<
* ignored for the JSX block below.
*/
// @ts-expect-error
<Component
ref={ref}
className={className}
children={children ?? defaultChildren}
{...resolvedProps}
/>
<Component ref={ref} className={className} {...resolvedProps}>
{children ?? defaultChildren}
</Component>
);
});
component.displayName = displayName;
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://turbo.build/schema.json",
"globalEnv": ["NEXT_PUBLIC_APTOS_API_KEY"],
"globalEnv": ["GAID", "NEXT_PUBLIC_APTOS_API_KEY"],
"tasks": {
"build": {
"dependsOn": ["^build"],
Expand Down

0 comments on commit 74e4d02

Please sign in to comment.