Closed t-hamano closed 2 months ago
This PR adds three new rules to ESLint that are also introduced in the Gutenberg project.
I believe these rules will improve code quality, prevent unintended problems, and make it easier for contributors.
Force import statements to add External, WordPress, and Internal as comments to indicate what they depend on.
External
WordPress
Internal
import CodeMirror from '@uiw/react-codemirror'; import { __, sprintf } from '@wordpress/i18n'; import { fetchThemeJson } from '../resolvers';
/** * External dependencies */ import CodeMirror from '@uiw/react-codemirror'; /** * WordPress dependencies */ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ import { fetchThemeJson } from '../resolvers';
Forces the text domain called create-block-theme in the translation function.
create-block-theme
__( 'Hello World' ) __( 'Hello World', 'create-block' )
__( 'Hello World', 'create-block-theme' )
Forces the value to be omitted if the value of props is true.
true
<TextControl disabled={ true } />
<TextControl disabled />
@mikachan Thanks for the review!
P.S. Since I have been invited as a member of this repository, I would like to merge only the approved PRs myself.
This PR adds three new rules to ESLint that are also introduced in the Gutenberg project.
I believe these rules will improve code quality, prevent unintended problems, and make it easier for contributors.
Rules
@wordpress/dependency-group
Force import statements to add
External
,WordPress
, andInternal
as comments to indicate what they depend on.❌
✅
@wordpress/i18n-text-domain
Forces the text domain called
create-block-theme
in the translation function.❌
✅
react/jsx-boolean-value
Forces the value to be omitted if the value of props is
true
.❌
✅
Testing Instructions