{"_id":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule","_rev":"2-8dcacae42cf3262ac4c31b442ae6dcef","name":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule","version":"1.0.0","private":false,"publishConfig":{"access":"public"},"main":"cjs/index.js","author":{"name":"ant1m4tt3r","url":"https://github.com/ant1m4tt3r"},"dependencies":{"@typescript-eslint/utils":"^6.20.0"},"devDependencies":{"@typescript-eslint/parser":"^6.1.0","@typescript-eslint/rule-tester":"^6.20.0","eslint":"^8.45.0","typescript":"^5.1.6","vitest":"^0.33.0"},"peerDependencies":{"@eslint/eslintrc":">=2"},"keywords":["eslint","eslintplugin","eslint-plugin","use-effect"],"license":"ISC","scripts":{"build":"pnpm tsc -b","test":"vitest"},"types":"./cjs/index.d.ts","_id":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule@1.0.0","_integrity":"sha512-OdvV+96/tB7iQkmbLK29wLbotDVhvG8Nr7PTlY00O4gGEprvP89/igoIHs1DjZSRoInbje2iVZh4FSMQne68cA==","_resolved":"/private/var/folders/2j/ytvcy1sj5psfhtgx704mfppm0000gn/T/bba88c7e1f06ebd552252f70a9a2802a/antimatter-labs-eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.0.tgz","_from":"file:antimatter-labs-eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.0.tgz","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-OdvV+96/tB7iQkmbLK29wLbotDVhvG8Nr7PTlY00O4gGEprvP89/igoIHs1DjZSRoInbje2iVZh4FSMQne68cA==","shasum":"a584c5ff8c7070bc59cf3e1a04dc01b5841d4636","tarball":"https://registry.npmjs.org/@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule/-/eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.0.tgz","fileCount":12,"unpackedSize":12381,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUR2PKnvL1pddKukE/F4O+k3xirXeMewCrxJEwEKXkcQIgL5O2tKIJKqWKCfMfpVb/G1nQL4FA7ucvJ/M54WGP8dA="}]},"_npmUser":{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"},"directories":{},"maintainers":[{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-no-anonymous-use-effect-callback-rule_1.0.0_1707064484291_0.8581932951538163"},"_hasShrinkwrap":false},"1.0.1":{"name":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule","version":"1.0.1","private":false,"publishConfig":{"access":"public"},"main":"cjs/index.js","author":{"name":"ant1m4tt3r","url":"https://github.com/ant1m4tt3r"},"dependencies":{"@typescript-eslint/utils":"^6.20.0"},"devDependencies":{"@typescript-eslint/parser":"^6.1.0","@typescript-eslint/rule-tester":"^6.20.0","eslint":"^8.45.0","typescript":"^5.1.6","vitest":"^0.33.0"},"peerDependencies":{"@eslint/eslintrc":">=2"},"keywords":["eslint","eslintplugin","eslint-plugin","use-effect"],"license":"ISC","scripts":{"build":"pnpm tsc -b","test":"vitest"},"types":"./cjs/index.d.ts","description":"This package provides an opinionated eslint rule that enhances the readability and maintainability of `React.useEffect` usage, by suggesting the usage of names functions for `useEffect` callbacks.","_id":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule@1.0.1","_integrity":"sha512-lovryIPnsawRAUlbzLDuSFMl8bPoqmjMcl0rm7N/ry2jGoiQOWIYFooUKRJ72KBO1ZLpllHavrXMgN8Y4vLCAw==","_resolved":"/private/var/folders/2j/ytvcy1sj5psfhtgx704mfppm0000gn/T/c0c832e9a68559350778a307248c7610/antimatter-labs-eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.1.tgz","_from":"file:antimatter-labs-eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.1.tgz","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-lovryIPnsawRAUlbzLDuSFMl8bPoqmjMcl0rm7N/ry2jGoiQOWIYFooUKRJ72KBO1ZLpllHavrXMgN8Y4vLCAw==","shasum":"786e5ab9f3f380f79ece4186aa6b01649d3e372e","tarball":"https://registry.npmjs.org/@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule/-/eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.1.tgz","fileCount":13,"unpackedSize":13857,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/sP4WXBQD/Bk9qwdF+zTE0y5wRmMje82oygpzZh+a9QIgZ4DkKDWbxCW25FB/uy6o5GBk8rNyEw0TfZM09euRWKA="}]},"_npmUser":{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"},"directories":{},"maintainers":[{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-no-anonymous-use-effect-callback-rule_1.0.1_1707065507863_0.5705414650235345"},"_hasShrinkwrap":false},"1.0.2":{"name":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule","version":"1.0.2","private":false,"publishConfig":{"access":"public"},"main":"cjs/index.js","author":{"name":"ant1m4tt3r","url":"https://github.com/ant1m4tt3r"},"repository":{"type":"git","url":"git+https://github.com/ant1m4tt3r/eslint-plugin-no-anonymous-use-effect-callback-rule.git"},"dependencies":{"@typescript-eslint/utils":"^6.20.0"},"devDependencies":{"@typescript-eslint/parser":"^6.1.0","@typescript-eslint/rule-tester":"^6.20.0","eslint":"^8.45.0","typescript":"^5.1.6","vitest":"^0.33.0"},"peerDependencies":{"@eslint/eslintrc":">=2"},"keywords":["eslint","eslintplugin","eslint-plugin","use-effect"],"license":"ISC","scripts":{"build":"pnpm tsc -b","test":"vitest"},"types":"./cjs/index.d.ts","description":"This package provides an opinionated eslint rule that enhances the readability and maintainability of `React.useEffect` usage, by suggesting the usage of names functions for `useEffect` callbacks.","bugs":{"url":"https://github.com/ant1m4tt3r/eslint-plugin-no-anonymous-use-effect-callback-rule/issues"},"homepage":"https://github.com/ant1m4tt3r/eslint-plugin-no-anonymous-use-effect-callback-rule#readme","_id":"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule@1.0.2","_integrity":"sha512-qLGl3MNJUnF+A/wZlltDX+HJO/OPcXKcJbJ1VpS6plnyxr/sI2+0QnE/doZjyLMWKPXU9aUH+zke3qiXzy+usA==","_resolved":"/private/var/folders/2j/ytvcy1sj5psfhtgx704mfppm0000gn/T/32f3a5e2bb159b44e28846f32a1a97a2/antimatter-labs-eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.2.tgz","_from":"file:antimatter-labs-eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.2.tgz","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-qLGl3MNJUnF+A/wZlltDX+HJO/OPcXKcJbJ1VpS6plnyxr/sI2+0QnE/doZjyLMWKPXU9aUH+zke3qiXzy+usA==","shasum":"4297c36ee2c892bde8545a3acf36d097b86e9713","tarball":"https://registry.npmjs.org/@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule/-/eslint-plugin-no-anonymous-use-effect-callback-rule-1.0.2.tgz","fileCount":13,"unpackedSize":14299,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbSyxOLSjCuvZ8aKI8Z8PoYtwx7fgcd2InATImnLeUrwIhAIJiwm+aBgwtt0+RO6IErkdTPnUKs4X3N399Bs9GRlwF"}]},"_npmUser":{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"},"directories":{},"maintainers":[{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-no-anonymous-use-effect-callback-rule_1.0.2_1707065842672_0.0013053430428273671"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-04T16:34:44.187Z","1.0.0":"2024-02-04T16:34:44.443Z","modified":"2024-02-04T16:57:23.034Z","1.0.1":"2024-02-04T16:51:48.002Z","1.0.2":"2024-02-04T16:57:22.830Z"},"maintainers":[{"name":"ant1m4tt3r","email":"hugo.azd1@gmail.com"}],"keywords":["eslint","eslintplugin","eslint-plugin","use-effect"],"author":{"name":"ant1m4tt3r","url":"https://github.com/ant1m4tt3r"},"license":"ISC","readme":"# @antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule\n\nThis package provides an opinionated eslint rule that enhances the readability and maintainability of `React.useEffect` usage, by suggesting the usage\nof names functions for `useEffect` callbacks.\n\nThis was inspired by this [tweet](https://twitter.com/housecor/status/1750980809874436431) of [Cory House](https://twitter.com/housecor). Thanks!\n\n### TLDR\n\nIt will make eslint scream at you if you write\n```js\nuseEffect(() => {\n   fetch('...').then(() => console.log(\"Complete!\"))\n}, [])\n```\n\ninstead of writing\n```js\nuseEffect(function initialComponentFetch() {\n   fetch('...').then(() => console.log(\"Complete!\"))\n}, [])\n```\n\n\n### Usage\n\nInstall it using your package manager:\n```\nnpm i -D @antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule\n```\n```\nyarn add -D @antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule\n```\n```\npnpm add -D @antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule\n```\n\nIn your eslint config file add the following (remeber to replace <severity> with the desired value: `\"error\"`, `\"warn\"`...)\n\n```json\n{\n  ...\n  \"plugins\": [\n    ...,\n    \"@antimatter-labs/eslint-plugin-no-anonymous-use-effect-callback-rule\"\n  ],\n  \"rules\": {\n    ...,\n    \"@antimatter-labs/no-anonymous-use-effect-callback-rule/base\": [\"<severity>\"]\n  },\n}\n```\n\nThe rule act on the following expressions and will trigger a message with the severity specified by you in your eslint config.\n\n```js\nimport * as React from 'react'\n\nfunction MyComponent() {\n  React.useEffect(function () {})\n  React.useEffect(() => {})\n\n  return ...\n}\n```\n\n```js\nimport * as React from 'react'\n\nfunction MyComponent() {\n  useEffect(function () {})\n  useEffect(() => {})\n\n  return ...\n}\n```","readmeFilename":"README.md","description":"This package provides an opinionated eslint rule that enhances the readability and maintainability of `React.useEffect` usage, by suggesting the usage of names functions for `useEffect` callbacks.","homepage":"https://github.com/ant1m4tt3r/eslint-plugin-no-anonymous-use-effect-callback-rule#readme","repository":{"type":"git","url":"git+https://github.com/ant1m4tt3r/eslint-plugin-no-anonymous-use-effect-callback-rule.git"},"bugs":{"url":"https://github.com/ant1m4tt3r/eslint-plugin-no-anonymous-use-effect-callback-rule/issues"}}