Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lodash: Remove completely from eslint-plugin package #43420

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/eslint-plugin/docs/rules/dependency-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
```
Expand All @@ -22,7 +22,7 @@ Examples of **correct** code for this rule:
/*
* External dependencies
*/
import { get } from 'lodash';
import { camelCase } from 'change-case';

/*
* WordPress dependencies
Expand Down
12 changes: 6 additions & 6 deletions packages/eslint-plugin/rules/__tests__/dependency-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ruleTester.run( 'dependency-group', rule, {
/**
* External dependencies
*/
import { get } from 'lodash';
import { camelCase } from 'change-case';
import classnames from 'classnames';

/**
Expand All @@ -40,7 +40,7 @@ import edit from './edit';`,
/**
* External dependencies
*/
const { get } = require( 'lodash' );
const { camelCase } = require( 'change-case' );
const classnames = require( 'classnames' );

/**
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -95,7 +95,7 @@ import edit from './edit';`,
},
{
code: `
const { get } = require( 'lodash' );
const { camelCase } = require( 'change-case' );
const classnames = require( 'classnames' );
/*
* wordpress dependencies.
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions packages/eslint-plugin/rules/__tests__/no-unsafe-wp-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down