From 31efc210d00b6ebfb7f626424088972fc75b9b4e Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Fri, 19 Aug 2022 13:46:16 +0300 Subject: [PATCH] Lodash: Remove completely from eslint-plugin package --- .../eslint-plugin/docs/rules/dependency-group.md | 4 ++-- .../rules/__tests__/dependency-group.js | 12 ++++++------ .../rules/__tests__/no-unsafe-wp-apis.js | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/dependency-group.md b/packages/eslint-plugin/docs/rules/dependency-group.md index 2ddcfa50c08bd..e3910544aedb7 100644 --- a/packages/eslint-plugin/docs/rules/dependency-group.md +++ b/packages/eslint-plugin/docs/rules/dependency-group.md @@ -11,7 +11,7 @@ Specifically, this ensures that: Examples of **incorrect** code for this rule: ```js -import { get } from 'lodash'; +import { camelCase } from 'change-case'; import { Component } from '@wordpress/element'; import edit from './edit'; ``` @@ -22,7 +22,7 @@ Examples of **correct** code for this rule: /* * External dependencies */ -import { get } from 'lodash'; +import { camelCase } from 'change-case'; /* * WordPress dependencies diff --git a/packages/eslint-plugin/rules/__tests__/dependency-group.js b/packages/eslint-plugin/rules/__tests__/dependency-group.js index 0f0731c96323d..2db53e9ed666a 100644 --- a/packages/eslint-plugin/rules/__tests__/dependency-group.js +++ b/packages/eslint-plugin/rules/__tests__/dependency-group.js @@ -22,7 +22,7 @@ ruleTester.run( 'dependency-group', rule, { /** * External dependencies */ -import { get } from 'lodash'; +import { camelCase } from 'change-case'; import classnames from 'classnames'; /** @@ -40,7 +40,7 @@ import edit from './edit';`, /** * External dependencies */ -const { get } = require( 'lodash' ); +const { camelCase } = require( 'change-case' ); const classnames = require( 'classnames' ); /** @@ -57,7 +57,7 @@ const edit = require( './edit' );`, invalid: [ { code: ` -import { get } from 'lodash'; +import { camelCase } from 'change-case'; import classnames from 'classnames'; /* * wordpress dependencies. @@ -82,7 +82,7 @@ import edit from './edit';`, /** * External dependencies */ -import { get } from 'lodash'; +import { camelCase } from 'change-case'; import classnames from 'classnames'; /** * WordPress dependencies @@ -95,7 +95,7 @@ import edit from './edit';`, }, { code: ` -const { get } = require( 'lodash' ); +const { camelCase } = require( 'change-case' ); const classnames = require( 'classnames' ); /* * wordpress dependencies. @@ -120,7 +120,7 @@ const edit = require( './edit' );`, /** * External dependencies */ -const { get } = require( 'lodash' ); +const { camelCase } = require( 'change-case' ); const classnames = require( 'classnames' ); /** * WordPress dependencies diff --git a/packages/eslint-plugin/rules/__tests__/no-unsafe-wp-apis.js b/packages/eslint-plugin/rules/__tests__/no-unsafe-wp-apis.js index 1eb1805aebb0d..946bf3cbd1c44 100644 --- a/packages/eslint-plugin/rules/__tests__/no-unsafe-wp-apis.js +++ b/packages/eslint-plugin/rules/__tests__/no-unsafe-wp-apis.js @@ -21,15 +21,15 @@ const options = [ ruleTester.run( 'no-unsafe-wp-apis', rule, { valid: [ - { code: "import _ from 'lodash';", options }, - { code: "import { map } from 'lodash';", options }, - { code: "import { __experimentalFoo } from 'lodash';", options }, - { code: "import { __unstableFoo } from 'lodash';", options }, - { code: "import _, { __unstableFoo } from 'lodash';", options }, - { code: "import * as _ from 'lodash';", options }, + { code: "import _ from 'change-case';", options }, + { code: "import { camelCase } from 'change-case';", options }, + { code: "import { __experimentalFoo } from 'change-case';", options }, + { code: "import { __unstableFoo } from 'change-case';", options }, + { code: "import _, { __unstableFoo } from 'change-case';", options }, + { code: "import * as _ from 'change-case';", options }, { code: "import _ from './x';", options }, - { code: "import { map } from './x';", options }, + { code: "import { camelCase } from './x';", options }, { code: "import { __experimentalFoo } from './x';", options }, { code: "import { __unstableFoo } from './x';", options }, { code: "import _, { __unstableFoo } from './x';", options },