{"id":30833108,"url":"https://github.com/ilovepixelart/eslint-plugin-lodash-es","last_synced_at":"2026-01-20T17:35:22.329Z","repository":{"id":313348770,"uuid":"1051036587","full_name":"ilovepixelart/eslint-plugin-lodash-es","owner":"ilovepixelart","description":"ESLint plugin for lodash-es","archived":false,"fork":false,"pushed_at":"2025-09-05T12:59:53.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T14:03:29.308Z","etag":null,"topics":["autofixable","destructuring","eslint","eslintplugin","imports","lodash","lodash-es"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilovepixelart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T10:44:13.000Z","updated_at":"2025-09-05T12:59:57.000Z","dependencies_parsed_at":"2025-09-05T14:03:31.751Z","dependency_job_id":"ba5fa197-d0f5-4204-954b-48084a4c6525","html_url":"https://github.com/ilovepixelart/eslint-plugin-lodash-es","commit_stats":null,"previous_names":["ilovepixelart/eslint-plugin-lodash-es"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ilovepixelart/eslint-plugin-lodash-es","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovepixelart%2Feslint-plugin-lodash-es","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovepixelart%2Feslint-plugin-lodash-es/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovepixelart%2Feslint-plugin-lodash-es/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovepixelart%2Feslint-plugin-lodash-es/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilovepixelart","download_url":"https://codeload.github.com/ilovepixelart/eslint-plugin-lodash-es/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovepixelart%2Feslint-plugin-lodash-es/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273863186,"owners_count":25181551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autofixable","destructuring","eslint","eslintplugin","imports","lodash","lodash-es"],"created_at":"2025-09-06T16:08:26.742Z","updated_at":"2026-01-20T17:35:22.317Z","avatar_url":"https://github.com/ilovepixelart.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-lodash-es\n\n[![npm](https://img.shields.io/npm/v/eslint-plugin-lodash-es)](https://www.npmjs.com/package/eslint-plugin-lodash-es)\n[![npm](https://img.shields.io/npm/dt/eslint-plugin-lodash-es)](https://www.npmjs.com/package/eslint-plugin-lodash-es)\n[![GitHub](https://img.shields.io/github/license/ilovepixelart/eslint-plugin-lodash-es)](https://github.com/ilovepixelart/eslint-plugin-lodash-es/blob/main/LICENSE)\n\\\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ilovepixelart_eslint-plugin-lodash-es\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=ilovepixelart_eslint-plugin-lodash-es)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ilovepixelart_eslint-plugin-lodash-es\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ilovepixelart_eslint-plugin-lodash-es)\n\\\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ilovepixelart_eslint-plugin-lodash-es\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=ilovepixelart_eslint-plugin-lodash-es)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ilovepixelart_eslint-plugin-lodash-es\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=ilovepixelart_eslint-plugin-lodash-es)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ilovepixelart_eslint-plugin-lodash-es\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=ilovepixelart_eslint-plugin-lodash-es)\n\nESLint plugin that enforces destructured imports from lodash-es with auto-fixing and provides configurable function usage policies.\n\n**Key Benefits:**\n\n- 🔧 Auto-fixes imports for better tree-shaking\n- 📦 Reduces bundle size significantly\n- 🛡️ Configurable function usage policies\n- 💡 Intelligent suggestions for native alternatives\n- 📝 Full TypeScript support\n\n## Installation\n\n```bash\nnpm install -D eslint-plugin-lodash-es\n```\n\n## Usage\n\n### Flat config\n\n```javascript\n// eslint.config.js (ESLint 9+)\nimport eslintPluginLodashEs from 'eslint-plugin-lodash-es'\n\nexport default [\n  ...eslintPluginLodashEs.configs.recommended\n]\n```\n\n### Define config\n\n```javascript\nimport { defineConfig } from 'eslint/config'\n\n// Base\nimport globals from 'globals'\nimport eslint from '@eslint/js'\nimport tseslint from 'typescript-eslint'\n// Plugins\nimport eslintPluginStylistic from '@stylistic/eslint-plugin'\nimport eslintPluginLodashEs from 'eslint-plugin-lodash-es'\n\nexport default defineConfig(\n  {\n    ignores: ['dist/', 'node_modules/', 'coverage/'],\n  },\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser, // or globals.node\n      },\n    },\n  },\n  //Base\n  eslint.configs.recommended,\n  tseslint.configs.strict,\n  tseslint.configs.stylistic,\n  // Plugins\n  eslintPluginStylistic.configs.recommended,\n  eslintPluginLodashEs.configs.recommended\n)\n\n```\n\n### Manual Configuration\n\n```javascript\n// eslint.config.js (ESLint 9+)\nexport default [\n  {\n    plugins: { 'lodash-es': eslintPluginLodashEs },\n    rules: {\n      'lodash-es/enforce-destructuring': 'error',\n      'lodash-es/no-chaining': 'error',\n      'lodash-es/no-method-imports': 'error',\n      'lodash-es/enforce-functions': ['error', { exclude: ['forEach'] }],\n      'lodash-es/suggest-native-alternatives': 'warn',\n    }\n  }\n]\n```\n\n### Legacy Config (ESLint 8)\n\n```javascript\n// .eslintrc.js\nmodule.exports = {\n  extends: ['plugin:lodash-es/recommended-legacy']\n}\n```\n\n## What it does\n\n### 1. Enforces Destructured Imports\n\nTransforms this:\n\n```typescript\nimport _ from 'lodash-es'\nconst result = _.first([1, 2, 3])\n```\n\nInto this (automatically):\n\n```typescript\nimport { first } from 'lodash-es'\nconst result = first([1, 2, 3])\n```\n\n### 2. Transforms to Native JavaScript\n\nTransforms this:\n\n```typescript\nimport { map, first, groupBy } from 'lodash-es'\n\nconst doubled = map([1, 2, 3], x =\u003e x * 2)\nconst firstItem = first(items)\nconst grouped = groupBy(users, 'department')\n```\n\nInto this (automatically):\n\n```typescript\nimport { map, first, groupBy } from 'lodash-es'\n\nconst doubled = [1, 2, 3].map(x =\u003e x * 2)\nconst firstItem = items.at(0)\nconst grouped = Object.groupBy(users, user =\u003e user.department)\n```\n\n**Supports 104+ lodash functions** with automatic transformation to modern JavaScript equivalents, including ES2022+ features like `Array.at()` and `Object.groupBy()`.\n\n### Recently Added Native Alternatives (37 new functions)\n\n**Array slice operations**: `drop`, `dropRight`, `take`, `takeRight`\n**Math \u0026 arithmetic**: `add`, `subtract`, `multiply`, `divide`, `sum`, `mean`\n**Number utilities**: `clamp`, `inRange`, `random`\n**String transformations**: `capitalize`, `lowerFirst`, `upperFirst` (using modern `.at()`)\n**Type checking**: `isDate`, `isRegExp`, `isError`, `isSet`, `isWeakMap`, `isWeakSet`, `isSymbol`, `isSafeInteger`\n**Type conversion**: `castArray`, `toArray`, `toFinite`, `toInteger`, `toSafeInteger`\n**Comparisons**: `eq`, `gt`, `gte`, `lt`, `lte`\n**Function utilities**: `bind`, `delay`, `defer`\n**Object creation**: `create`\n**Utility stubs**: `identity`, `noop`, `stubArray`, `stubFalse`, `stubObject`, `stubString`, `stubTrue`\n\n## Rules\n\n| Rule | Description | 💡 | 🔧 | ✅ |\n|------|-------------|:--:|:--:|:--:|\n| [enforce-destructuring](./docs/rules/enforce-destructuring.md) | Enforce destructured imports from lodash-es | | 🔧 | ✅ |\n| [no-chaining](./docs/rules/no-chaining.md) | Prevent chaining that kills tree-shaking | 💡 | 🔧 | ✅ |\n| [no-method-imports](./docs/rules/no-method-imports.md) | Prevent deprecated per-method imports | 💡 | 🔧 | ✅ |\n| [enforce-functions](./docs/rules/enforce-functions.md) | Transform lodash functions to native JavaScript | 💡 | 🔧 | |\n| [suggest-native-alternatives](./docs/rules/suggest-native-alternatives.md) | Suggest native JavaScript alternatives | 💡 | 🔧 | |\n\n**Legend:** 💡 Suggestions • 🔧 Auto-fixable • ✅ Recommended\n\n## Why Use This?\n\n**Bundle Size:** Reduces bundle from ~70KB (full lodash-es) to ~1KB per function\n\n**Better Tree Shaking:** Modern bundlers eliminate unused code more effectively\n\n**Team Standards:** Enforce consistent lodash usage across your codebase\n\n## Documentation\n\nSee [detailed rule documentation](./docs/rules/) for configuration options and examples.\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filovepixelart%2Feslint-plugin-lodash-es","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filovepixelart%2Feslint-plugin-lodash-es","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filovepixelart%2Feslint-plugin-lodash-es/lists"}