mirror of
https://github.com/WordPress/create-block-theme.git
synced 2025-08-17 14:51:20 +08:00
ESLint: Add new rules (#616)
This commit is contained in:
parent
17121fcea7
commit
59c3aac75e
12 changed files with 71 additions and 6 deletions
|
@ -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" ],
|
||||
|
|
|
@ -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 } ) => {
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
|
@ -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
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
@ -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 } ) => {
|
|||
</Text>
|
||||
<Spacer />
|
||||
<TextControl
|
||||
disabled={ true }
|
||||
disabled
|
||||
label={ __( 'Theme name', 'create-block-theme' ) }
|
||||
value={ theme.name }
|
||||
/>
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import {
|
||||
// eslint-disable-next-line
|
||||
__experimentalHStack as HStack,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import apiFetch from '@wordpress/api-fetch';
|
||||
|
||||
export async function fetchThemeJson() {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import apiFetch from '@wordpress/api-fetch';
|
||||
|
||||
async function loadUnavailableThemeNames() {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
/* eslint-disable no-console */
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
const fs = require( 'fs' );
|
||||
const core = require( '@actions/core' );
|
||||
const simpleGit = require( 'simple-git' );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* WordPress Dependencies
|
||||
* WordPress dependencies
|
||||
*/
|
||||
const defaultConfig = require( '@wordpress/scripts/config/webpack.config.js' );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue