Skip to content

chore: fixing eslint configuration #630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
uses: MetaMask/action-checkout-and-setup@v1
with:
is-high-risk-environment: false
- name: Setup
# The Tailwind Prettier plugin requires the Tailwind preset to be built, as the plugin depends on the configuration provided by the preset for linting to function correctly.
run: yarn workspace @metamask/design-system-tailwind-preset build
Comment on lines +39 to +41
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update to our linting step is required for ensuring that the Tailwind Prettier plugin operates correctly. By running yarn workspace @metamask/design-system-tailwind-preset build, we ensure that the Tailwind preset is built and its configuration is available. Without this step, the Tailwind Prettier plugin would fail to lint properly since it relies on the preset's configuration to validate styles accurately.

Without this update our CI will fail at the linting step. yarn lint will also fail locally if the tailwind preset is not built.

Screenshot 2025-05-12 at 4 03 40 PM

- run: yarn lint
- name: Require clean working directory
shell: bash
Expand Down
8 changes: 7 additions & 1 deletion apps/storybook-react/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that are set up within a monorepo.
*
* @param value
*/

/**

Check warning on line 11 in apps/storybook-react/.storybook/main.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Missing JSDoc @returns declaration
*
* @param value
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
Expand Down
17 changes: 13 additions & 4 deletions apps/storybook-react/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import '@metamask/design-tokens/src/css/index.css';
import '../tailwind.css';

import { Preview } from '@storybook/react';
import { StoryContext, StoryFn } from '@storybook/react';
import type { Preview } from '@storybook/react';
import type { StoryContext, StoryFn } from '@storybook/react';
import React from 'react';

export const globalTypes = {
colorScheme: {
Expand All @@ -22,13 +21,23 @@
},
};

/**

Check warning on line 24 in apps/storybook-react/.storybook/preview.tsx

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Missing JSDoc @returns declaration
*
* @param Story
* @param context
*/
function withColorScheme(Story: StoryFn, context: StoryContext) {
const storyColorScheme = context.parameters.colorScheme;
const globalColorScheme = context.globals.colorScheme;

// Use story-level parameter if available, otherwise fall back to global
const colorScheme = storyColorScheme || globalColorScheme;

/**

Check warning on line 36 in apps/storybook-react/.storybook/preview.tsx

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Missing JSDoc @returns declaration
*
* @param options0
* @param options0.children
*/
function Wrapper({
children,
...props
Expand Down
Loading
Loading