Skip to content

Conversation

@torleifhalseth
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restructures and significantly expands the project's documentation guidelines to provide clearer, more actionable guidance for developers. The documentation is transformed from simple bullet-point lists into comprehensive, well-structured guides with concrete examples.

Key changes:

  • Enhanced formatting with code examples demonstrating good and bad patterns
  • Organized content into clear sections with visual hierarchy
  • Added specific commands and practical instructions
  • Standardized structure across all guideline documents

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/instructions/ts.instructions.md Expanded TypeScript guidelines with type definition patterns, functional programming principles, and comprehensive testing examples
.github/instructions/styling.instructions.md Restructured CSS guidelines with BEM examples, responsive design patterns, and token usage
.github/instructions/react.instructions.md Enhanced React component structure documentation with file organization, implementation patterns, and accessibility requirements
.github/instructions/global-coding.instructions.md Improved global standards with formatted tables, practical commands, and clearer naming convention examples
.github/instructions/figma.instructions.md Expanded Figma workflow with numbered steps, anti-patterns, and a checklist
.github/copilot-instructions.md Simplified overview with streamlined package descriptions and guideline references

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings December 8, 2025 13:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.

Comment on lines +28 to +29
import { MyComponentProps } from './MyComponent.types';
import './my-component.css';
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolons in import statements. For consistency with TypeScript best practices, add semicolons after each import statement.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +42
export const MyComponent: React.FC<MyComponentProps> = ({
children,
variant = 'default',
...props
}) => {
return (
<div className="my-component" {...props}>
{children}
</div>
);
};
```
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolons at the end of the export statement and function body. Add semicolons for consistency with TypeScript best practices.

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +81
export const Button = () => {}
export const useButton = () => {}

// ❌ Avoid default exports
export default Button

// ✅ Import named exports
import { Button, useButton } from '@equinor/eds-core-react'

// ❌ Don't import default
import Button from '@equinor/eds-core-react'
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolons in export and import examples. For consistency with TypeScript best practices, add semicolons after each statement.

Suggested change
export const Button = () => {}
export const useButton = () => {}
// ❌ Avoid default exports
export default Button
// ✅ Import named exports
import { Button, useButton } from '@equinor/eds-core-react'
// ❌ Don't import default
import Button from '@equinor/eds-core-react'
export const Button = () => {};
export const useButton = () => {};
// ❌ Avoid default exports
export default Button;
// ✅ Import named exports
import { Button, useButton } from '@equinor/eds-core-react';
// ❌ Don't import default
import Button from '@equinor/eds-core-react';

Copilot uses AI. Check for mistakes.
**Rules:**

- No conditional hooks (move into separate components if needed)
- No React import needed (no JSX pragma in modern React)
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

The comment "No React import needed (no JSX pragma in modern React)" might be confusing. While it's true that React 17+ with the new JSX transform doesn't require importing React for JSX, the example code at lines 31-42 doesn't show any React import either. Consider clarifying this applies to JSX usage specifically, or show both cases (with and without JSX).

Suggested change
- No React import needed (no JSX pragma in modern React)
- For files using JSX with React 17+ and the new JSX transform, no React import is needed.
For non-JSX usage (e.g., using React APIs directly), you still need to import React.
Example (JSX, no import needed):
```typescript
// React 17+ with new JSX transform
export const MyComponent = () => <div>Hello</div>;

Example (non-JSX, import needed):

import * as React from 'react';
// Using React.createElement directly
export const MyComponent = () => React.createElement('div', null, 'Hello');

Copilot uses AI. Check for mistakes.
disabled?: boolean
}

const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolon at end of statement. For consistency with other examples in the documentation and TypeScript best practices, add a semicolon: const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {};

Suggested change
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {}
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {};

Copilot uses AI. Check for mistakes.

// ❌ Avoid
type ButtonVariant = string
const handleClick = (event: any) => {}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolon at end of statement. For consistency, add a semicolon: const handleClick = (event: any) => {};

Suggested change
const handleClick = (event: any) => {}
const handleClick = (event: any) => {};

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +53
render(<Button disabled>Loading</Button>);
const button = screen.getByRole('button');
expect(button).toBeDisabled();
});
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolons in the test example. For consistency with TypeScript best practices, add semicolons after each statement.

Copilot uses AI. Check for mistakes.
Comment on lines +59 to +65
padding: 0.5rem 1rem;
}

@media (min-width: 768px) {
.button {
padding: 0.75rem 1.5rem;
}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolons in CSS property declarations. Add semicolons after each property for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +52
color: var(--eds-color-text-strong);
background: var(--eds-color-bg-input);
border: 1px solid var(--eds-color-border-medium);
}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing semicolons in CSS property declarations. While CSS semicolons at the end of the last property in a block are optional, it's a best practice to include them for consistency and to prevent errors when adding new properties. Add semicolons after each property.

Copilot uses AI. Check for mistakes.
pomfrida
pomfrida previously approved these changes Dec 8, 2025
Copilot AI review requested due to automatic review settings December 8, 2025 13:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@pomfrida pomfrida merged commit 6b50852 into main Dec 8, 2025
10 checks passed
@pomfrida pomfrida deleted the chore/ai-context branch December 8, 2025 13:55
@pomfrida pomfrida self-assigned this Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants