Skip to content

Commit

Permalink
Update ESLint config for TypeScript files (#40584)
Browse files Browse the repository at this point in the history
* Update ESLint config for TypeScript files

* Change no-undefined-types to warning

* Remove unsed eslint-disable

* Restore 'jsdoc/require-returns'

* Turn off jsdoc/no-undefined-types

* Fix lints caused by turning off "jsdoc/no-undefined-types"

* Clean up jetpack-mu-wpcom/eslint.config.mjs

* Add changelog

* Restore plugins/jetpack/.eslintignore

* Turn back jsdoc/no-undefined-types ON with disabled reporting

* Re-enable param rules for now

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12353041998

Upstream-Ref: Automattic/jetpack@9f6b920
  • Loading branch information
zinigor authored and matticbot committed Dec 16, 2024
1 parent e5ae4d1 commit 96b9c39
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ node_modules export-ignore

# Files to exclude from the mirror repo
/changelog/** production-exclude
/.eslintrc.cjs production-exclude
/jest.config.cjs production-exclude
**/stories/** production-exclude
/tests/** production-exclude
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

This is an alpha version! The changes listed here are not final.

### Changed
- Updated package dependencies.

### Fixed
- Fixed lints following ESLint rule changes for TS

## [0.25.1] - 2024-12-09
### Changed
- AI Assistant: Add disclaimer to image generation modals [#40397]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type FairUsageNoticeProps = {
* The fair usage notice component.
* @param {FairUsageNoticeProps} props - Fair usage notice component props.
* @param {FairUsageNoticeProps.variant} props.variant - The variant of the notice to render.
* @return {ReactElement} the Notice component with the fair usage message.
* @return the Notice component with the fair usage message.
*/
export declare const FairUsageNotice: ({ variant }: FairUsageNoticeProps) => import("react/jsx-runtime").JSX.Element;
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useFairUsageNoticeMessage from '../hooks/use-fair-usage-notice-message.js
* The fair usage notice component.
* @param {FairUsageNoticeProps} props - Fair usage notice component props.
* @param {FairUsageNoticeProps.variant} props.variant - The variant of the notice to render.
* @return {ReactElement} the Notice component with the fair usage message.
* @return the Notice component with the fair usage message.
*/
export const FairUsageNotice = ({ variant = 'error' }) => {
const useFairUsageNoticeMessageElement = useFairUsageNoticeMessage();
Expand Down
4 changes: 2 additions & 2 deletions build/ai-client/src/logo-generator/store/reducer.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AiFeatureStateProps, LogoGeneratorStateProp, RequestError } from './types.js';
import type { AiFeatureStateProps, RequestError } from './types.js';
import type { SiteDetails } from '../types.js';
/**
* Reducer for the Logo Generator store.
Expand Down Expand Up @@ -27,7 +27,7 @@ import type { SiteDetails } from '../types.js';
* @param {boolean} action.isLoadingHistory - Whether the history is being loaded
* @return {LogoGeneratorStateProp} The new state
*/
export default function reducer(state: LogoGeneratorStateProp, action: {
export default function reducer(state: import("./types.js").LogoGeneratorStateProp, action: {
type: string;
feature?: AiFeatureStateProps;
count?: number;
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"prefer-stable": true,
"extra": {
"mirror-repo": "Automattic/jetpack-ai-client",
"textdomain": "jetpack-ai-client",
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-ai-client/compare/v${old}...v${new}"
},
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@
"main": "./build/index.js",
"types": "./build/index.d.ts",
"dependencies": {
"@automattic/jetpack-base-styles": "^0.6.38",
"@automattic/jetpack-connection": "^0.36.1",
"@automattic/jetpack-shared-extension-utils": "^0.16.1",
"@automattic/jetpack-base-styles": "^0.6.39-alpha",
"@automattic/jetpack-connection": "^0.36.2-alpha",
"@automattic/jetpack-shared-extension-utils": "^0.16.2-alpha",
"@microsoft/fetch-event-source": "2.0.1",
"@types/react": "18.3.12",
"@types/wordpress__block-editor": "11.5.15",
"@wordpress/api-fetch": "7.13.0",
"@wordpress/blob": "4.13.0",
"@wordpress/block-editor": "14.8.0",
"@wordpress/components": "28.13.0",
"@wordpress/compose": "7.13.0",
"@wordpress/data": "10.13.0",
"@wordpress/element": "6.13.0",
"@wordpress/i18n": "5.13.0",
"@wordpress/icons": "10.13.0",
"@wordpress/api-fetch": "7.14.0",
"@wordpress/blob": "4.14.0",
"@wordpress/block-editor": "14.9.0",
"@wordpress/components": "29.0.0",
"@wordpress/compose": "7.14.0",
"@wordpress/data": "10.14.0",
"@wordpress/element": "6.14.0",
"@wordpress/i18n": "5.14.0",
"@wordpress/icons": "10.14.0",
"clsx": "2.1.1",
"debug": "4.3.4",
"markdown-it": "14.0.0",
Expand Down
6 changes: 1 addition & 5 deletions src/logo-generator/components/fair-usage-notice.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Notice } from '@wordpress/components';
import useFairUsageNoticeMessage from '../hooks/use-fair-usage-notice-message.js';
/**
* Types
*/
import type { ReactElement } from 'react';

type FairUsageNoticeProps = {
variant?: 'error' | 'muted';
Expand All @@ -13,7 +9,7 @@ type FairUsageNoticeProps = {
* The fair usage notice component.
* @param {FairUsageNoticeProps} props - Fair usage notice component props.
* @param {FairUsageNoticeProps.variant} props.variant - The variant of the notice to render.
* @return {ReactElement} the Notice component with the fair usage message.
* @return the Notice component with the fair usage message.
*/
export const FairUsageNotice = ( { variant = 'error' }: FairUsageNoticeProps ) => {
const useFairUsageNoticeMessageElement = useFairUsageNoticeMessage();
Expand Down
7 changes: 1 addition & 6 deletions src/logo-generator/store/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ import {
ACTION_SET_IS_LOADING_HISTORY,
} from './constants.js';
import INITIAL_STATE from './initial-state.js';
import type {
AiFeatureStateProps,
LogoGeneratorStateProp,
RequestError,
TierLimitProp,
} from './types.js';
import type { AiFeatureStateProps, RequestError, TierLimitProp } from './types.js';
import type { SiteDetails } from '../types.js';

/**
Expand Down

0 comments on commit 96b9c39

Please sign in to comment.