diff --git a/packages/annotations/src/store/index.js b/packages/annotations/src/store/index.js index 917a342ad9f49d..1c7f27dccbc351 100644 --- a/packages/annotations/src/store/index.js +++ b/packages/annotations/src/store/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { registerStore } from '@wordpress/data'; diff --git a/packages/block-library/src/gallery/edit.js b/packages/block-library/src/gallery/edit.js index 1199b881f93b3f..f83704b9c8b857 100644 --- a/packages/block-library/src/gallery/edit.js +++ b/packages/block-library/src/gallery/edit.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import classnames from 'classnames'; import { filter, pick, map, get } from 'lodash'; diff --git a/packages/block-library/src/gallery/gallery-image.js b/packages/block-library/src/gallery/gallery-image.js index bbdd1db6a222cf..ff95dd1cc49cb4 100644 --- a/packages/block-library/src/gallery/gallery-image.js +++ b/packages/block-library/src/gallery/gallery-image.js @@ -1,10 +1,10 @@ /** - * External Dependencies + * External dependencies */ import classnames from 'classnames'; /** - * WordPress Dependencies + * WordPress dependencies */ import { Component, Fragment } from '@wordpress/element'; import { IconButton, Spinner } from '@wordpress/components'; diff --git a/packages/block-library/src/latest-comments/index.js b/packages/block-library/src/latest-comments/index.js index 2fc124997196bc..d742c1dcbbc241 100644 --- a/packages/block-library/src/latest-comments/index.js +++ b/packages/block-library/src/latest-comments/index.js @@ -1,11 +1,11 @@ /** - * WordPress dependencies. + * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { G, Path, SVG } from '@wordpress/components'; /** - * Internal dependencies. + * Internal dependencies */ import edit from './edit'; diff --git a/packages/components/src/draggable/index.js b/packages/components/src/draggable/index.js index 773b39c0b7bbb6..ab660a7de1dd43 100644 --- a/packages/components/src/draggable/index.js +++ b/packages/components/src/draggable/index.js @@ -4,7 +4,7 @@ import { noop } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { Component } from '@wordpress/element'; import { withSafeTimeout } from '@wordpress/compose'; diff --git a/packages/components/src/higher-order/navigate-regions/index.js b/packages/components/src/higher-order/navigate-regions/index.js index 88103941bd7388..ed5fb89dc7cf63 100644 --- a/packages/components/src/higher-order/navigate-regions/index.js +++ b/packages/components/src/higher-order/navigate-regions/index.js @@ -1,16 +1,16 @@ /** - * External Dependencies + * External dependencies */ import classnames from 'classnames'; /** - * WordPress Dependencies + * WordPress dependencies */ import { Component } from '@wordpress/element'; import { createHigherOrderComponent } from '@wordpress/compose'; /** - * Internal Dependencies + * Internal dependencies */ import KeyboardShortcuts from '../../keyboard-shortcuts'; diff --git a/packages/components/src/modal/header.js b/packages/components/src/modal/header.js index 7ce8b7473e89c7..0e92567ae54efe 100644 --- a/packages/components/src/modal/header.js +++ b/packages/components/src/modal/header.js @@ -4,7 +4,7 @@ import { __ } from '@wordpress/i18n'; /** - * Internal dependencies. + * Internal dependencies */ import IconButton from '../icon-button'; diff --git a/packages/components/src/navigable-container/container.js b/packages/components/src/navigable-container/container.js index 7471243cd48f9d..fe056fa25ddbf8 100644 --- a/packages/components/src/navigable-container/container.js +++ b/packages/components/src/navigable-container/container.js @@ -1,10 +1,10 @@ /** - * External Dependencies + * External dependencies */ import { omit, noop, isFunction } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { Component, forwardRef } from '@wordpress/element'; import { focus } from '@wordpress/dom'; diff --git a/packages/components/src/navigable-container/menu.js b/packages/components/src/navigable-container/menu.js index e97c2aece7c0a0..16411eec386a57 100644 --- a/packages/components/src/navigable-container/menu.js +++ b/packages/components/src/navigable-container/menu.js @@ -1,10 +1,10 @@ /** - * External Dependencies + * External dependencies */ import { includes } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { forwardRef } from '@wordpress/element'; import { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes'; diff --git a/packages/components/src/navigable-container/tabbable.js b/packages/components/src/navigable-container/tabbable.js index 3e1191d998e2dc..bc572522e9c9f5 100644 --- a/packages/components/src/navigable-container/tabbable.js +++ b/packages/components/src/navigable-container/tabbable.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { forwardRef } from '@wordpress/element'; import { TAB } from '@wordpress/keycodes'; diff --git a/packages/components/src/responsive-wrapper/index.js b/packages/components/src/responsive-wrapper/index.js index 5965b425d5eb84..7236f5eff1dc34 100644 --- a/packages/components/src/responsive-wrapper/index.js +++ b/packages/components/src/responsive-wrapper/index.js @@ -4,7 +4,7 @@ import classnames from 'classnames'; /** - * WordPress Dependencies + * WordPress dependencies */ import { cloneElement, Children } from '@wordpress/element'; diff --git a/packages/components/src/server-side-render/index.js b/packages/components/src/server-side-render/index.js index 71d649dfbf6440..660521d5ce5196 100644 --- a/packages/components/src/server-side-render/index.js +++ b/packages/components/src/server-side-render/index.js @@ -1,10 +1,10 @@ /** - * External dependencies. + * External dependencies */ import { isEqual, debounce } from 'lodash'; /** - * WordPress dependencies. + * WordPress dependencies */ import { Component, @@ -15,7 +15,7 @@ import apiFetch from '@wordpress/api-fetch'; import { addQueryArgs } from '@wordpress/url'; /** - * Internal dependencies. + * Internal dependencies */ import Placeholder from '../placeholder'; import Spinner from '../spinner'; diff --git a/packages/components/src/slot-fill/test/slot.js b/packages/components/src/slot-fill/test/slot.js index 47ba2e16de5247..bacc5e55e0fe3c 100644 --- a/packages/components/src/slot-fill/test/slot.js +++ b/packages/components/src/slot-fill/test/slot.js @@ -12,7 +12,7 @@ import Fill from '../fill'; import Provider from '../context'; /** - * WordPress Dependencies + * WordPress dependencies */ import { Component } from '@wordpress/element'; diff --git a/packages/e2e-test-utils/src/create-url.js b/packages/e2e-test-utils/src/create-url.js index 14437e0476666d..5bc9e6df3a59d4 100644 --- a/packages/e2e-test-utils/src/create-url.js +++ b/packages/e2e-test-utils/src/create-url.js @@ -1,5 +1,5 @@ /** - * Node dependencies + * External dependencies */ import { join } from 'path'; import { URL } from 'url'; diff --git a/packages/e2e-test-utils/src/is-current-url.js b/packages/e2e-test-utils/src/is-current-url.js index 01b78ffde05767..6062f241d48548 100644 --- a/packages/e2e-test-utils/src/is-current-url.js +++ b/packages/e2e-test-utils/src/is-current-url.js @@ -1,5 +1,5 @@ /** - * Node dependencies + * External dependencies */ import { URL } from 'url'; diff --git a/packages/e2e-test-utils/src/visit-admin-page.js b/packages/e2e-test-utils/src/visit-admin-page.js index 4878f69d277f02..12a8f327e544b8 100644 --- a/packages/e2e-test-utils/src/visit-admin-page.js +++ b/packages/e2e-test-utils/src/visit-admin-page.js @@ -1,5 +1,5 @@ /** - * Node dependencies + * External dependencies */ import { join } from 'path'; diff --git a/packages/e2e-tests/specs/adding-inline-tokens.test.js b/packages/e2e-tests/specs/adding-inline-tokens.test.js index ee2572e1556b77..6fe5d42e849122 100644 --- a/packages/e2e-tests/specs/adding-inline-tokens.test.js +++ b/packages/e2e-tests/specs/adding-inline-tokens.test.js @@ -1,5 +1,5 @@ /** - * Node dependencies + * External dependencies */ import path from 'path'; import fs from 'fs'; diff --git a/packages/e2e-tests/specs/manage-reusable-blocks.test.js b/packages/e2e-tests/specs/manage-reusable-blocks.test.js index 2eaa22e219f255..05af841189a831 100644 --- a/packages/e2e-tests/specs/manage-reusable-blocks.test.js +++ b/packages/e2e-tests/specs/manage-reusable-blocks.test.js @@ -1,5 +1,5 @@ /** - * Node dependencies + * External dependencies */ import path from 'path'; diff --git a/packages/edit-post/src/components/fullscreen-mode/test/index.js b/packages/edit-post/src/components/fullscreen-mode/test/index.js index e61f5e1838ff2a..928722b340da24 100644 --- a/packages/edit-post/src/components/fullscreen-mode/test/index.js +++ b/packages/edit-post/src/components/fullscreen-mode/test/index.js @@ -4,7 +4,7 @@ import { shallow } from 'enzyme'; /** - * Internal dependencies. + * Internal dependencies */ import { FullscreenMode } from '..'; diff --git a/packages/edit-post/src/components/header/feature-toggle/index.js b/packages/edit-post/src/components/header/feature-toggle/index.js index c2de21f3ba713e..4e0df7f3749b08 100644 --- a/packages/edit-post/src/components/header/feature-toggle/index.js +++ b/packages/edit-post/src/components/header/feature-toggle/index.js @@ -4,7 +4,7 @@ import { flow } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; diff --git a/packages/edit-post/src/components/header/fullscreen-mode-close/index.js b/packages/edit-post/src/components/header/fullscreen-mode-close/index.js index 2cbde749470f62..3b1c42472db6d2 100644 --- a/packages/edit-post/src/components/header/fullscreen-mode-close/index.js +++ b/packages/edit-post/src/components/header/fullscreen-mode-close/index.js @@ -1,10 +1,10 @@ /** - * External Dependencies + * External dependencies */ import { get } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { withSelect } from '@wordpress/data'; import { IconButton, Toolbar } from '@wordpress/components'; diff --git a/packages/edit-post/src/components/header/options-menu-item/index.js b/packages/edit-post/src/components/header/options-menu-item/index.js index 66fcb5cd7cb3c1..812da4a7e49b38 100644 --- a/packages/edit-post/src/components/header/options-menu-item/index.js +++ b/packages/edit-post/src/components/header/options-menu-item/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { withDispatch } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; diff --git a/packages/edit-post/src/components/header/post-publish-button-or-toggle.js b/packages/edit-post/src/components/header/post-publish-button-or-toggle.js index edf6699fc9eaff..828ba3ef6fc049 100644 --- a/packages/edit-post/src/components/header/post-publish-button-or-toggle.js +++ b/packages/edit-post/src/components/header/post-publish-button-or-toggle.js @@ -1,10 +1,10 @@ /** - * External Dependencies + * External dependencies */ import { get } from 'lodash'; /** - * WordPress dependencies. + * WordPress dependencies */ import { compose } from '@wordpress/compose'; import { withDispatch, withSelect } from '@wordpress/data'; diff --git a/packages/edit-post/src/components/header/test/index.js b/packages/edit-post/src/components/header/test/index.js index b672c74607b2fe..e5e0516a94951e 100644 --- a/packages/edit-post/src/components/header/test/index.js +++ b/packages/edit-post/src/components/header/test/index.js @@ -4,7 +4,7 @@ import { shallow } from 'enzyme'; /** - * Internal dependencies. + * Internal dependencies */ import { PostPublishButtonOrToggle } from '../post-publish-button-or-toggle'; diff --git a/packages/edit-post/src/components/header/writing-menu/index.js b/packages/edit-post/src/components/header/writing-menu/index.js index 6a3b6f62c44828..5a909d1c6ab386 100644 --- a/packages/edit-post/src/components/header/writing-menu/index.js +++ b/packages/edit-post/src/components/header/writing-menu/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { MenuGroup } from '@wordpress/components'; import { __, _x } from '@wordpress/i18n'; diff --git a/packages/edit-post/src/components/sidebar/index.js b/packages/edit-post/src/components/sidebar/index.js index 900b8725e6d775..b043403d8bf32e 100644 --- a/packages/edit-post/src/components/sidebar/index.js +++ b/packages/edit-post/src/components/sidebar/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { createSlotFill, withFocusReturn } from '@wordpress/components'; import { withSelect } from '@wordpress/data'; diff --git a/packages/edit-post/src/components/sidebar/post-status/index.js b/packages/edit-post/src/components/sidebar/post-status/index.js index 4fedfa5fe286ab..ba8705cd19641a 100644 --- a/packages/edit-post/src/components/sidebar/post-status/index.js +++ b/packages/edit-post/src/components/sidebar/post-status/index.js @@ -8,7 +8,7 @@ import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; /** - * Internal Dependencies + * Internal dependencies */ import PostVisibility from '../post-visibility'; import PostTrash from '../post-trash'; diff --git a/packages/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js b/packages/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js index d354464caabce6..5c85446e0ac141 100644 --- a/packages/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js +++ b/packages/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import { get } from 'lodash'; diff --git a/packages/edit-post/src/components/sidebar/settings-sidebar/index.js b/packages/edit-post/src/components/sidebar/settings-sidebar/index.js index 3d4fa8dfb0ced9..d6874aa100f04f 100644 --- a/packages/edit-post/src/components/sidebar/settings-sidebar/index.js +++ b/packages/edit-post/src/components/sidebar/settings-sidebar/index.js @@ -8,7 +8,7 @@ import { BlockInspector } from '@wordpress/editor'; import { Fragment } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; /** - * Internal Dependencies + * Internal dependencies */ import Sidebar from '../'; import SettingsHeader from '../settings-header'; diff --git a/packages/edit-post/src/hooks/components/media-upload/index.js b/packages/edit-post/src/hooks/components/media-upload/index.js index c8552168033899..0b4fe40ce4ea99 100644 --- a/packages/edit-post/src/hooks/components/media-upload/index.js +++ b/packages/edit-post/src/hooks/components/media-upload/index.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import { castArray, defaults, pick } from 'lodash'; diff --git a/packages/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js b/packages/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js index b8c84c0645e59f..92587f90f3afa0 100644 --- a/packages/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js +++ b/packages/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { MenuItem } from '@wordpress/components'; import { withDispatch } from '@wordpress/data'; diff --git a/packages/edit-post/src/store/index.js b/packages/edit-post/src/store/index.js index 7158916711a775..9294d7cd90ac6b 100644 --- a/packages/edit-post/src/store/index.js +++ b/packages/edit-post/src/store/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { registerStore } from '@wordpress/data'; diff --git a/packages/editor/src/components/block-drop-zone/index.js b/packages/editor/src/components/block-drop-zone/index.js index a6f426aa6e2667..1a8bb142aae893 100644 --- a/packages/editor/src/components/block-drop-zone/index.js +++ b/packages/editor/src/components/block-drop-zone/index.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import classnames from 'classnames'; diff --git a/packages/editor/src/components/block-inspector/index.js b/packages/editor/src/components/block-inspector/index.js index 737b0863cbc2ef..ee2405a3bac14e 100644 --- a/packages/editor/src/components/block-inspector/index.js +++ b/packages/editor/src/components/block-inspector/index.js @@ -13,7 +13,7 @@ import { withSelect } from '@wordpress/data'; import { Fragment } from '@wordpress/element'; /** - * Internal Dependencies + * Internal dependencies */ import SkipToSelectedBlock from '../skip-to-selected-block'; import BlockIcon from '../block-icon'; diff --git a/packages/editor/src/components/block-list/block-html.js b/packages/editor/src/components/block-list/block-html.js index ca2c057dc8a400..fc7b3da86ef080 100644 --- a/packages/editor/src/components/block-list/block-html.js +++ b/packages/editor/src/components/block-list/block-html.js @@ -1,12 +1,12 @@ /** - * External Dependencies + * External dependencies */ import TextareaAutosize from 'react-autosize-textarea'; import { isEqual } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { Component } from '@wordpress/element'; import { compose } from '@wordpress/compose'; diff --git a/packages/editor/src/components/block-toolbar/index.js b/packages/editor/src/components/block-toolbar/index.js index e37fbdb2e46aa3..3da857dbd1b99c 100644 --- a/packages/editor/src/components/block-toolbar/index.js +++ b/packages/editor/src/components/block-toolbar/index.js @@ -1,11 +1,11 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { withSelect } from '@wordpress/data'; import { Fragment } from '@wordpress/element'; /** - * Internal Dependencies + * Internal dependencies */ import BlockSwitcher from '../block-switcher'; import MultiBlocksSwitcher from '../block-switcher/multi-blocks-switcher'; diff --git a/packages/editor/src/components/multi-selection-inspector/index.js b/packages/editor/src/components/multi-selection-inspector/index.js index 5378c5fe6f539f..51b48333923a5f 100644 --- a/packages/editor/src/components/multi-selection-inspector/index.js +++ b/packages/editor/src/components/multi-selection-inspector/index.js @@ -11,7 +11,7 @@ import { } from '@wordpress/components'; /** - * Internal Dependencies + * Internal dependencies */ import BlockIcon from '../block-icon'; diff --git a/packages/editor/src/components/post-permalink/index.js b/packages/editor/src/components/post-permalink/index.js index c28a1d1754485f..5205997f76e5ea 100644 --- a/packages/editor/src/components/post-permalink/index.js +++ b/packages/editor/src/components/post-permalink/index.js @@ -15,7 +15,7 @@ import { ClipboardButton, Button, ExternalLink } from '@wordpress/components'; import { safeDecodeURI } from '@wordpress/url'; /** - * Internal Dependencies + * Internal dependencies */ import PostPermalinkEditor from './editor.js'; import { getWPAdminURL, cleanForSlug } from '../../utils/url'; diff --git a/packages/editor/src/components/post-publish-panel/index.js b/packages/editor/src/components/post-publish-panel/index.js index 0aef7ae9a3393e..9f5e0e6814e178 100644 --- a/packages/editor/src/components/post-publish-panel/index.js +++ b/packages/editor/src/components/post-publish-panel/index.js @@ -19,7 +19,7 @@ import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; /** - * Internal Dependencies + * Internal dependencies */ import PostPublishButton from '../post-publish-button'; import PostPublishPanelPrepublish from './prepublish'; diff --git a/packages/editor/src/components/post-publish-panel/maybe-post-format-panel.js b/packages/editor/src/components/post-publish-panel/maybe-post-format-panel.js index 81e89698b4bf91..d3a853b4eb7136 100644 --- a/packages/editor/src/components/post-publish-panel/maybe-post-format-panel.js +++ b/packages/editor/src/components/post-publish-panel/maybe-post-format-panel.js @@ -4,7 +4,7 @@ import { find, get, includes } from 'lodash'; /** - * WordPress dependencies. + * WordPress dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { ifCondition, compose } from '@wordpress/compose'; @@ -12,7 +12,7 @@ import { withDispatch, withSelect } from '@wordpress/data'; import { Button, PanelBody } from '@wordpress/components'; /** - * Internal dependencies. + * Internal dependencies */ import { POST_FORMATS } from '../post-format'; diff --git a/packages/editor/src/components/post-publish-panel/postpublish.js b/packages/editor/src/components/post-publish-panel/postpublish.js index 0e0cc7f81862b1..97fb7ff7ca3cdf 100644 --- a/packages/editor/src/components/post-publish-panel/postpublish.js +++ b/packages/editor/src/components/post-publish-panel/postpublish.js @@ -1,10 +1,10 @@ /** - * External Dependencies + * External dependencies */ import { get } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { PanelBody, Button, ClipboardButton, TextControl } from '@wordpress/components'; import { __, sprintf } from '@wordpress/i18n'; diff --git a/packages/editor/src/components/post-publish-panel/prepublish.js b/packages/editor/src/components/post-publish-panel/prepublish.js index e05f97e5784ac1..6006ec5ce5b46c 100644 --- a/packages/editor/src/components/post-publish-panel/prepublish.js +++ b/packages/editor/src/components/post-publish-panel/prepublish.js @@ -12,7 +12,7 @@ import { PanelBody } from '@wordpress/components'; import { withSelect } from '@wordpress/data'; /** - * Internal Dependencies + * Internal dependencies */ import PostVisibility from '../post-visibility'; import PostVisibilityLabel from '../post-visibility/label'; diff --git a/packages/editor/src/components/post-taxonomies/check.js b/packages/editor/src/components/post-taxonomies/check.js index 432e1e15506a7f..ab078b1bc70da4 100644 --- a/packages/editor/src/components/post-taxonomies/check.js +++ b/packages/editor/src/components/post-taxonomies/check.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import { some, includes } from 'lodash'; diff --git a/packages/editor/src/components/post-taxonomies/index.js b/packages/editor/src/components/post-taxonomies/index.js index b6d10a1a9b3acc..75159bd2f6875e 100644 --- a/packages/editor/src/components/post-taxonomies/index.js +++ b/packages/editor/src/components/post-taxonomies/index.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import { filter, identity, includes } from 'lodash'; diff --git a/packages/editor/src/components/post-visibility/index.js b/packages/editor/src/components/post-visibility/index.js index 672a450c88d1ad..7115ee7ba12250 100644 --- a/packages/editor/src/components/post-visibility/index.js +++ b/packages/editor/src/components/post-visibility/index.js @@ -7,7 +7,7 @@ import { withInstanceId, compose } from '@wordpress/compose'; import { withSelect, withDispatch } from '@wordpress/data'; /** - * Internal Dependencies + * Internal dependencies */ import { visibilityOptions } from './utils'; diff --git a/packages/editor/src/components/post-visibility/label.js b/packages/editor/src/components/post-visibility/label.js index 1b296bc45ad3ac..7c54c3f5b2de85 100644 --- a/packages/editor/src/components/post-visibility/label.js +++ b/packages/editor/src/components/post-visibility/label.js @@ -9,7 +9,7 @@ import { find } from 'lodash'; import { withSelect } from '@wordpress/data'; /** - * Internal Dependencies + * Internal dependencies */ import { visibilityOptions } from './utils'; diff --git a/packages/editor/src/components/post-visibility/utils.js b/packages/editor/src/components/post-visibility/utils.js index 53163db0743036..42268ff062ad2d 100644 --- a/packages/editor/src/components/post-visibility/utils.js +++ b/packages/editor/src/components/post-visibility/utils.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { __ } from '@wordpress/i18n'; diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index a889bb01c14acb..f22f129cc8acf7 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -4,7 +4,7 @@ import { flow, map } from 'lodash'; /** - * WordPress Dependencies + * WordPress dependencies */ import { createElement, Component } from '@wordpress/element'; import { DropZoneProvider, SlotFillProvider } from '@wordpress/components'; diff --git a/packages/editor/src/components/server-side-render/index.js b/packages/editor/src/components/server-side-render/index.js index 8c69cfca9a1322..5830612ebcc36b 100644 --- a/packages/editor/src/components/server-side-render/index.js +++ b/packages/editor/src/components/server-side-render/index.js @@ -1,5 +1,5 @@ /** - * WordPress dependencies. + * WordPress dependencies */ import { ServerSideRender } from '@wordpress/components'; import { select } from '@wordpress/data'; diff --git a/packages/editor/src/components/skip-to-selected-block/index.js b/packages/editor/src/components/skip-to-selected-block/index.js index d55f4b04bdd7ca..7fb58d88b59da6 100644 --- a/packages/editor/src/components/skip-to-selected-block/index.js +++ b/packages/editor/src/components/skip-to-selected-block/index.js @@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; /** - * Internal Dependencies + * Internal dependencies */ import { getBlockFocusableWrapper } from '../../utils/dom'; diff --git a/packages/editor/src/editor-styles/ast/stringify/index.js b/packages/editor/src/editor-styles/ast/stringify/index.js index 0253ad968cc678..9a5b995f059b0a 100644 --- a/packages/editor/src/editor-styles/ast/stringify/index.js +++ b/packages/editor/src/editor-styles/ast/stringify/index.js @@ -2,7 +2,7 @@ // because we needed to remove source map support. /** - * Internal dependencies. + * Internal dependencies */ import Compressed from './compress'; import Identity from './identity'; diff --git a/packages/editor/src/store/actions.js b/packages/editor/src/store/actions.js index c12a0cb0c6bf76..2043f21ed9a03e 100644 --- a/packages/editor/src/store/actions.js +++ b/packages/editor/src/store/actions.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import { castArray } from 'lodash'; diff --git a/packages/editor/src/store/index.js b/packages/editor/src/store/index.js index fb8f9fe11d5cc6..11fa1c76eaf8ce 100644 --- a/packages/editor/src/store/index.js +++ b/packages/editor/src/store/index.js @@ -1,5 +1,5 @@ /** - * WordPress Dependencies + * WordPress dependencies */ import { registerStore } from '@wordpress/data'; diff --git a/packages/editor/src/utils/media-upload/media-upload.js b/packages/editor/src/utils/media-upload/media-upload.js index 3cba5212f62712..3aed464f5c4c6e 100644 --- a/packages/editor/src/utils/media-upload/media-upload.js +++ b/packages/editor/src/utils/media-upload/media-upload.js @@ -1,5 +1,5 @@ /** - * External Dependencies + * External dependencies */ import { compact, diff --git a/packages/eslint-plugin/rules/__tests__/dependency-group.js b/packages/eslint-plugin/rules/__tests__/dependency-group.js index 74e41626bfcd87..2089b9ab3ec021 100644 --- a/packages/eslint-plugin/rules/__tests__/dependency-group.js +++ b/packages/eslint-plugin/rules/__tests__/dependency-group.js @@ -19,18 +19,18 @@ ruleTester.run( 'dependency-group', rule, { valid: [ { code: ` -/* +/** * External dependencies */ import { get } from 'lodash'; import classnames from 'classnames'; -/* +/** * WordPress dependencies */ import { Component } from '@wordpress/element'; -/* +/** * Internal dependencies */ import edit from './edit';`, @@ -41,6 +41,9 @@ import edit from './edit';`, code: ` import { get } from 'lodash'; import classnames from 'classnames'; +/* + * wordpress dependencies. + */ import { Component } from '@wordpress/element'; import edit from './edit';`, errors: [ diff --git a/packages/eslint-plugin/rules/dependency-group.js b/packages/eslint-plugin/rules/dependency-group.js index c92345a905cb7a..995250e53c1871 100644 --- a/packages/eslint-plugin/rules/dependency-group.js +++ b/packages/eslint-plugin/rules/dependency-group.js @@ -18,6 +18,28 @@ module.exports = { * @typedef {string} WPPackageLocality */ + /** + * Object describing a dependency block correction to be made. + * + * @property {?espree.Node} comment Comment node on which to replace + * value, if one can be salvaged. + * @property {string} value Expected comment node value. + * + * @typedef {Object} WPDependencyBlockCorrection + */ + + /** + * Given a desired locality, generates the expected comment node value + * property. + * + * @param {WPPackageLocality} locality Desired package locality. + * + * @return {string} Expected comment node value. + */ + function getCommentValue( locality ) { + return `*\n * ${ locality } dependencies\n `; + } + /** * Given an import source string, returns the locality classification * of the import sort. @@ -51,7 +73,7 @@ module.exports = { return false; } - // (Temporary) Tolerances: + // Tolerances: // - Normalize `/**` and `/*` // - Case insensitive "Dependencies" vs. "dependencies" // - Ending period @@ -61,7 +83,7 @@ module.exports = { locality = '(External|Node)'; } - const pattern = new RegExp( `^\\*?\\n \\* ${ locality } [dD]ependencies\\.?\\n $` ); + const pattern = new RegExp( `^\\*?\\n \\* ${ locality } dependencies\\.?\\n $`, 'i' ); return pattern.test( value ); } @@ -79,18 +101,44 @@ module.exports = { } /** - * Returns true if a given node is preceded by a comment block - * satisfying a locality requirement, or false otherwise. + * Tests source comments to determine whether a comment exists which + * satisfies the desired locality. If a match is found and requires no + * updates, the function returns undefined. Otherwise, it will return + * a WPDependencyBlockCorrection object describing a correction. * * @param {espree.Node} node Node to test. * @param {WPPackageLocality} locality Desired package locality. * - * @return {boolean} Whether node preceded by locality comment block. + * @return {?WPDependencyBlockCorrection} Correction, if applicable. */ - function isPrecededByDependencyBlock( node, locality ) { - return comments.some( ( comment ) => { - return isLocalityDependencyBlock( comment, locality ) && isBefore( comment, node ); - } ); + function getDependencyBlockCorrection( node, locality ) { + const value = getCommentValue( locality ); + + let comment; + for ( let i = 0; i < comments.length; i++ ) { + comment = comments[ i ]; + + if ( ! isBefore( comment, node ) ) { + // Exhausted options. + break; + } + + if ( ! isLocalityDependencyBlock( comment, locality ) ) { + // Not usable (either not an block comment, or not one + // matching a tolerable pattern). + continue; + } + + if ( comment.value === value ) { + // No change needed. (OK) + return; + } + + // Found a comment needing correction. + return { comment, value }; + } + + return { value }; } return { @@ -103,7 +151,7 @@ module.exports = { * * @type {Set} */ - const reported = new Set(); + const verified = new Set(); // Since we only care to enforce imports which occur at the // top-level scope, match on Program and test its children, @@ -133,23 +181,31 @@ module.exports = { } const locality = getPackageLocality( source ); - if ( - reported.has( locality ) || - isPrecededByDependencyBlock( child, locality ) - ) { + if ( verified.has( locality ) ) { return; } - reported.add( locality ); + // Avoid verifying any other imports for the locality, + // regardless whether a correction must be made. + verified.add( locality ); + + // Determine whether a correction must be made. + const correction = getDependencyBlockCorrection( child, locality ); + if ( ! correction ) { + return; + } context.report( { node: child, message: `Expected preceding "${ locality } dependencies" comment block`, fix( fixer ) { - return fixer.insertTextBefore( - child, - `/**\n * ${ locality } dependencies\n */\n` - ); + const { comment, value } = correction; + const text = `/*${ value }*/`; + if ( comment ) { + return fixer.replaceText( comment, text ); + } + + return fixer.insertTextBefore( child, text + '\n' ); }, } ); } ); diff --git a/packages/is-shallow-equal/test/index.js b/packages/is-shallow-equal/test/index.js index 49f2526dbdf279..8a7e80cf02156d 100644 --- a/packages/is-shallow-equal/test/index.js +++ b/packages/is-shallow-equal/test/index.js @@ -1,5 +1,5 @@ /** - * Internal Dependencies + * Internal dependencies */ import isShallowEqual from '../'; import isShallowEqualArrays from '../arrays'; diff --git a/packages/wordcount/src/test/index.test.js b/packages/wordcount/src/test/index.test.js index 467b5f8c5359d4..2537ca49e213a2 100644 --- a/packages/wordcount/src/test/index.test.js +++ b/packages/wordcount/src/test/index.test.js @@ -1,5 +1,5 @@ /** - * Internal Dependencies + * Internal dependencies */ import { count } from '../';