diff --git a/.eslintrc.json b/.eslintrc.json index d993f136..0b8e5d2e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,6 +4,16 @@ "FileReader": true, "FontFace": true }, + "rules": { + "@wordpress/dependency-group": "error", + "@wordpress/i18n-text-domain": [ + "error", + { + "allowedTextDomain": "create-block-theme" + } + ], + "react/jsx-boolean-value": "error" + }, "overrides": [ { "files": [ "**/test/**/*.js" ], diff --git a/src/editor-sidebar/create-panel.js b/src/editor-sidebar/create-panel.js index 7279f8b9..ab061313 100644 --- a/src/editor-sidebar/create-panel.js +++ b/src/editor-sidebar/create-panel.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import { __ } from '@wordpress/i18n'; import { useState } from '@wordpress/element'; import { useDispatch, useSelect } from '@wordpress/data'; @@ -21,6 +24,9 @@ import { } from '@wordpress/components'; import { addCard, copy } from '@wordpress/icons'; +/** + * Internal dependencies + */ import ScreenHeader from './screen-header'; export const CreateThemePanel = ( { createType } ) => { diff --git a/src/editor-sidebar/create-variation-panel.js b/src/editor-sidebar/create-variation-panel.js index e0e93e58..71d878df 100644 --- a/src/editor-sidebar/create-variation-panel.js +++ b/src/editor-sidebar/create-variation-panel.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import { __ } from '@wordpress/i18n'; import { useState } from '@wordpress/element'; import { useDispatch } from '@wordpress/data'; @@ -16,8 +19,11 @@ import { TextControl, } from '@wordpress/components'; import { copy } from '@wordpress/icons'; -import { postCreateThemeVariation } from '../resolvers'; +/** + * Internal dependencies + */ +import { postCreateThemeVariation } from '../resolvers'; import ScreenHeader from './screen-header'; export const CreateVariationPanel = () => { diff --git a/src/editor-sidebar/json-editor-modal.js b/src/editor-sidebar/json-editor-modal.js index cd28dcdd..3776fee5 100644 --- a/src/editor-sidebar/json-editor-modal.js +++ b/src/editor-sidebar/json-editor-modal.js @@ -1,9 +1,20 @@ +/** + * External dependencies + */ +import CodeMirror from '@uiw/react-codemirror'; +import { json } from '@codemirror/lang-json'; + +/** + * WordPress dependencies + */ import { __, sprintf } from '@wordpress/i18n'; import { useState, useEffect } from '@wordpress/element'; import { Modal } from '@wordpress/components'; import { useSelect } from '@wordpress/data'; -import CodeMirror from '@uiw/react-codemirror'; -import { json } from '@codemirror/lang-json'; + +/** + * Internal dependencies + */ import { fetchThemeJson } from '../resolvers'; const ThemeJsonEditorModal = ( { onRequestClose } ) => { @@ -34,7 +45,7 @@ const ThemeJsonEditorModal = ( { onRequestClose } ) => { extensions={ [ json() ] } value={ themeData } onChange={ handleSave } - readOnly={ true } + readOnly /> ); diff --git a/src/editor-sidebar/metadata-editor-modal.js b/src/editor-sidebar/metadata-editor-modal.js index 7ada74f1..95b1bb3e 100644 --- a/src/editor-sidebar/metadata-editor-modal.js +++ b/src/editor-sidebar/metadata-editor-modal.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import { __, sprintf } from '@wordpress/i18n'; import { useState } from '@wordpress/element'; import { useSelect, useDispatch } from '@wordpress/data'; @@ -15,6 +18,10 @@ import { TextareaControl, ExternalLink, } from '@wordpress/components'; + +/** + * Internal dependencies + */ import { postUpdateThemeMetadata } from '../resolvers'; export const ThemeMetadataEditorModal = ( { onRequestClose } ) => { @@ -92,7 +99,7 @@ export const ThemeMetadataEditorModal = ( { onRequestClose } ) => { diff --git a/src/editor-sidebar/save-panel.js b/src/editor-sidebar/save-panel.js index 5c57e4d4..73e77f80 100644 --- a/src/editor-sidebar/save-panel.js +++ b/src/editor-sidebar/save-panel.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import { __ } from '@wordpress/i18n'; import { useSelect, useDispatch } from '@wordpress/data'; import { store as noticesStore } from '@wordpress/notices'; @@ -16,6 +19,9 @@ import { import { archive } from '@wordpress/icons'; import { store as preferencesStore } from '@wordpress/preferences'; +/** + * Internal dependencies + */ import ScreenHeader from './screen-header'; const PREFERENCE_SCOPE = 'create-block-theme'; diff --git a/src/editor-sidebar/screen-header.js b/src/editor-sidebar/screen-header.js index afe76537..55aa5440 100644 --- a/src/editor-sidebar/screen-header.js +++ b/src/editor-sidebar/screen-header.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import { // eslint-disable-next-line __experimentalHStack as HStack, diff --git a/src/plugin-sidebar.js b/src/plugin-sidebar.js index 57ba08e6..71ba269e 100644 --- a/src/plugin-sidebar.js +++ b/src/plugin-sidebar.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import { useState } from '@wordpress/element'; import { registerPlugin } from '@wordpress/plugins'; import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-site'; @@ -39,6 +42,9 @@ import { blockMeta, } from '@wordpress/icons'; +/** + * Internal dependencies + */ import { CreateThemePanel } from './editor-sidebar/create-panel'; import ThemeJsonEditorModal from './editor-sidebar/json-editor-modal'; import { SaveThemePanel } from './editor-sidebar/save-panel'; diff --git a/src/resolvers.js b/src/resolvers.js index 36aa9260..3a0281aa 100644 --- a/src/resolvers.js +++ b/src/resolvers.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import apiFetch from '@wordpress/api-fetch'; export async function fetchThemeJson() { diff --git a/src/wp-org-theme-directory.js b/src/wp-org-theme-directory.js index 1b2b71df..8d350c6f 100644 --- a/src/wp-org-theme-directory.js +++ b/src/wp-org-theme-directory.js @@ -1,3 +1,6 @@ +/** + * WordPress dependencies + */ import apiFetch from '@wordpress/api-fetch'; async function loadUnavailableThemeNames() { diff --git a/update-version-and-changelog.js b/update-version-and-changelog.js index 68d8e829..f79944cb 100644 --- a/update-version-and-changelog.js +++ b/update-version-and-changelog.js @@ -1,4 +1,8 @@ /* eslint-disable no-console */ + +/** + * External dependencies + */ const fs = require( 'fs' ); const core = require( '@actions/core' ); const simpleGit = require( 'simple-git' ); diff --git a/webpack.config.js b/webpack.config.js index 344379ee..acd7f2b5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ const defaultConfig = require( '@wordpress/scripts/config/webpack.config.js' );