{"name":"eslint-plugin-no-use-extend-native","version":"0.7.3","description":"ESLint plugin to prevent use of extended native objects","scripts":{"lint":"eslint .","test":"npm run lint && c8 ava"},"repository":{"type":"git","url":"git+https://github.com/dustinspecker/eslint-plugin-no-use-extend-native.git"},"bugs":{"url":"https://github.com/dustinspecker/eslint-plugin-no-use-extend-native/issues"},"homepage":"https://github.com/dustinspecker/eslint-plugin-no-use-extend-native","type":"module","engines":{"node":">=18.18.0"},"keywords":["eslint","eslintplugin","eslint-plugin","extend","native","prototype"],"author":{"name":"Dustin Specker"},"contributors":[{"name":"Brett Zamir"}],"license":"MIT","exports":"./index.js","dependencies":{"is-get-set-prop":"^2.0.0","is-js-type":"^3.0.0","is-obj-prop":"^2.0.0","is-proto-prop":"^3.0.1"},"devDependencies":{"@babel/core":"^7.24.6","@babel/eslint-parser":"^7.24.6","@babel/plugin-syntax-import-assertions":"^7.24.6","@babel/plugin-syntax-import-attributes":"^7.24.6","@eslint/js":"^9.3.0","ava":"^6.1.3","c8":"^10.0.0","eslint-ava-rule-tester":"^5.0.1","eslint-path-formatter":"^0.1.1","eslint-plugin-eslint-plugin":"^6.1.0","eslint-plugin-new-with-error":"^5.0.0","globals":"^15.3.0"},"peerDependencies":{"eslint":"^9.3.0 || ^10.0.0"},"c8":{"reporter":["lcov","text"]},"_id":"eslint-plugin-no-use-extend-native@0.7.3","gitHead":"f4fbc972193df15090a15d0beee01f923d182551","_nodeVersion":"22.2.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-kYJhgZkiZIavu/wIwrO+n4GemQcMX53kWCNZNr7nGMkRD1aBFLkDpBivEYP7nIJINCo9fzPbFjrpeX5kr2Qbww==","shasum":"cdbd01132bc7a097ea13fee74bc7c337679edc3f","tarball":"http://registry-npm.ywwl.com/eslint-plugin-no-use-extend-native/download/eslint-plugin-no-use-extend-native-0.7.3.tgz","fileCount":5,"unpackedSize":10411,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDxVMwlomUFpIjpVku04atqKCLgxbNo3nunM8Lt+2KShgIgbHI+YtAvvR8Hs35tsDqadIZRa7uzw1tVRVdU1WcKS1s="}],"size":3801,"noattachment":false,"key":"/eslint-plugin-no-use-extend-native/-/eslint-plugin-no-use-extend-native-0.7.3.tgz"},"_npmUser":{"name":"dustinspecker","email":"DustinSpecker@DustinSpecker.com"},"directories":{},"maintainers":[{"name":"dustinspecker","email":"DustinSpecker@DustinSpecker.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-no-use-extend-native_0.7.3_1777249564119_0.13736585051063321"},"_hasShrinkwrap":false,"readme":"# eslint-plugin-no-use-extend-native\n[![NPM version](https://badge.fury.io/js/eslint-plugin-no-use-extend-native.svg)](https://badge.fury.io/js/eslint-plugin-no-use-extend-native)\n[![Coverage Status](https://coveralls.io/repos/github/dustinspecker/eslint-plugin-no-use-extend-native/badge.svg?branch=main)](https://coveralls.io/github/dustinspecker/eslint-plugin-no-use-extend-native?branch=main)\n\n> ESLint plugin to prevent use of extended native objects\n\n## Install\nFirst, install ESLint via\n```\nnpm install --save-dev eslint\n```\n\nThen install eslint-plugin-no-use-extend-native\n```\nnpm install --save-dev eslint-plugin-no-use-extend-native\n```\n\n## Usage\nIn your `eslint.config.js` file add the plugin as such:\n\n```javascript\nimport eslintPluginNoUseExtendNative from 'eslint-plugin-no-use-extend-native'\n\nexport default [\n  {\n    plugins: {\n      'no-use-extend-native': eslintPluginNoUseExtendNative,\n    },\n    rules: {\n      'no-use-extend-native/no-use-extend-native': 2,\n    },\n  },\n]\n```\n\nIf you want the default of the single rule being enabled as an error, you can also just use the following instead of\nall of the above:\n\n```javascript\nimport eslintPluginNoUseExtendNative from 'eslint-plugin-no-use-extend-native'\n\nexport default [\n  eslintPluginNoUseExtendNative.configs.recommended,\n]\n```\n\nWith this plugin enabled, ESLint will find issues with using extended native objects:\n```javascript\nimport colors from 'colors';\nconsole.log('unicorn'.green);\n// => ESLint will give an error stating 'Avoid using extended native objects'\n\n[].customFunction();\n// => ESLint will give an error stating 'Avoid using extended native objects'\n```\n\nMore examples can be seen in the [tests](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native/blob/master/test/test.js).\n\n\n## Usage with no-extend-native\n\nESLint's [`no-extend-native`][no-extend-native] rule verifies code is not **modifying** a native prototype. e.g., with the `no-extend-native` rule enabled, the following lines are each considered incorrect:\n```javascript\nString.prototype.shortHash = function() { return this.substring(0, 7); };\nObject.defineProperty(Array.prototype, \"times\", { value: 999 });\n```\n\n`no-use-extend-native` verifies code is not **using** a non-native prototype. e.g., with the `no-use-extend-native` plugin enabled, the following line is considered incorrect:\n```javascript\n\"50bda47b09923e045759db8e8dd01a0bacd97370\".shortHash() === \"50bda47\";\n```\n\nThe `no-use-extend-native` plugin is designed to work with ESLint's `no-extend-native` rule. `no-extend-native` ensures that native prototypes aren't extended, and should a third party library extend them, `no-use-extend-native` ensures those changes aren't depended upon.\n\n[no-extend-native]: http://eslint.org/docs/rules/no-extend-native\n\n\n## LICENSE\nMIT © [Dustin Specker](https://github.com/dustinspecker)\n","publish_time":1777249564263,"_cnpm_publish_time":1777249564263,"dist-tags":{"latest":"0.7.3"}}