Enforce dependencies docblocks formatting (dependency-group)

Ensures that all top-level package imports adhere to the a dependency group.

Specifically, this ensures that:

Rule details

Examples of incorrect code for this rule:

import { get } from 'lodash';
import edit from './edit';

Examples of correct code for this rule:

/**
 * External dependencies
 */
import { get } from 'lodash';

/**
 * Internal dependencies
 */
import edit from './edit';

Setup

Import the teft plugin and define the rule in rules. You can also add a more dependency groups based on your needs.

{
	...
	plugins: [ '@teft' ],
	rules: {
		'@teft/dependency-group': [ 'error', {
			groups: [
				{ org: '@teft', name: 'Teft' }
			],
		} ],
	},
	...
}