{"_id":"@azsxdc12356/eslint-plugin-vue-ref-value","_rev":"7-1b27c3c2e85e0bd0d6988f3c60bc7f9d","name":"@azsxdc12356/eslint-plugin-vue-ref-value","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.0","keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.0","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"homepage":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value#readme","bugs":{"url":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value/issues"},"dist":{"shasum":"5cd3955507a088653bc52242cacc43b75f7ddbac","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.0.tgz","fileCount":7,"integrity":"sha512-dVgeAtMyATW4wqOuFucQk7i9wBvdmYvBxRoAUM5sXSEsau9s5N6DWYNNYPyMVJxOyztn7sktlPPl1+LE8Qt5TQ==","signatures":[{"sig":"MEUCIHEqk0I8uBsnOt5UuNBGTVR+5M+qkBDYObToGcK/QcY6AiEAqsjBtGPRE94XoXTa7Amql/yCoj/7hsPnSFa4Fw7GolY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18441},"main":"src/index.js","type":"commonjs","gitHead":"4a92ac34fd3d859434be8e3cab3fffd9d1f229e8","scripts":{"test":"mocha tests/**/*.js"},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"repository":{"url":"git+https://github.com/azsxdc12356/eslint-plugin-vue-ref-value.git","type":"git"},"_npmVersion":"10.1.0","description":"ESLint plugin to detect missing .value when using Vue ref variables","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.0.0","eslint":"^8.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-vue-ref-value_1.0.0_1775756465764_0.020042858424367482","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.1","keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.1","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"homepage":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value#readme","bugs":{"url":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value/issues"},"dist":{"shasum":"d3786d741e7c35a22f045696356f958313f3a3f2","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.1.tgz","fileCount":7,"integrity":"sha512-c2H1k81gozxM6I0q+HZWo/2JS14OgGROPyi6vSheEucWMuACvhF58cBIvXWpsi0JGf/0HyRFrAOToerNwdr5Dw==","signatures":[{"sig":"MEUCIGbkWRyKgESGkzyogLFyYgtLh9RZwfAlZ5mP2D3YWbUNAiEAjtPRMLuu/ZHZhOBI0p1c3jc03NhYEvhcVHMQZ97FSFI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19783},"main":"src/index.js","type":"commonjs","gitHead":"c55299d0fe36d5e5cbd493a8fab6d86e782293c7","scripts":{"test":"mocha tests/**/*.js"},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"repository":{"url":"git+https://github.com/azsxdc12356/eslint-plugin-vue-ref-value.git","type":"git"},"_npmVersion":"10.1.0","description":"ESLint plugin to detect missing .value when using Vue ref variables","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.0.0","eslint":"^8.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-vue-ref-value_1.0.1_1775757782153_0.8361508864313298","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.2","keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.2","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"homepage":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value#readme","bugs":{"url":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value/issues"},"dist":{"shasum":"b80254f925f9b2e2d84d7dd2452170e4204b90e3","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.2.tgz","fileCount":7,"integrity":"sha512-7g7s28Gx/EJ4vDqRtcbXzIffYBGKCQksKiZ2jHv3T1aITraK1J/yGj1NX1u6nHThIYEH6rh6JSg6fmfs3LGVUw==","signatures":[{"sig":"MEYCIQCMHlGHSaDL3QNDtkXgGZDmjSojDJlu4KzXZ9d39PGmAAIhAK5GEeFwGD/y+2QBfBnIewWGBPGB0lUowlVi9SYEw9PY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19797},"main":"src/index.js","type":"commonjs","gitHead":"70600cd353ffbdf5fdad8618f6a542a1cafa3723","scripts":{"test":"mocha tests/**/*.js"},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"repository":{"url":"git+https://github.com/azsxdc12356/eslint-plugin-vue-ref-value.git","type":"git"},"_npmVersion":"10.1.0","description":"ESLint plugin to detect missing .value when using Vue ref variables","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.0.0","eslint":"^8.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-vue-ref-value_1.0.2_1775758356146_0.6382347379499431","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.3","keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.3","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"homepage":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value#readme","bugs":{"url":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value/issues"},"dist":{"shasum":"86391c1607259ae5eff0e3357b5b706ad23766ea","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.3.tgz","fileCount":7,"integrity":"sha512-xfC4iKARRLoMfmmuGNLkgwMwsOex5iErVdHvIluV6Q5RNYJShpVHjcMNGpk1vS4xxOaBRQziOooPoJ+H6iLE5A==","signatures":[{"sig":"MEUCIE/eCWnkOo+MkLr1ARNw8eQl3LGEBI9lzdERXcnRwSFhAiEAr4L4YViKWBoSPuTmv5B4V3WfJPWGmApsV5C935O95oA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23661},"main":"src/index.js","type":"commonjs","gitHead":"aee36c2e81d43ee3f7933ecba1b75b80f19ad06d","scripts":{"push":"npm run push:git && npm run push:npm","test":"mocha tests/**/*.js","release":"npm version patch && npm run push","push:git":"git push origin main","push:npm":"npm publish --registry https://registry.npmjs.org --access public"},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"repository":{"url":"git+https://github.com/azsxdc12356/eslint-plugin-vue-ref-value.git","type":"git"},"_npmVersion":"10.1.0","description":"ESLint plugin to detect missing .value when using Vue ref variables","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.0.0","eslint":"^8.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-vue-ref-value_1.0.3_1776180232905_0.100303629102515","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.4","keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.4","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"homepage":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value#readme","bugs":{"url":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value/issues"},"dist":{"shasum":"623bb36afa72a5a8ce9a30404fea8bd3e591ea49","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.4.tgz","fileCount":7,"integrity":"sha512-Pm3IlEUUKJm/W6IwYFkTO+mPq8060o2Zc9tsWrvPMqU75SWI1nTf65beWU33GHhBfXNWsPs1i/XcxJ4ZAmD2mw==","signatures":[{"sig":"MEUCIBiPGAM/YBp3l7pQL9nn0ltbjwS5C7D1dj8syidXtZ2KAiEAuvWREp2TKAU5SxTfh4bftGZfofL6y1H93ILBv5ZXmwA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26443},"main":"src/index.js","type":"commonjs","gitHead":"eeb7263be078470139d5023e7ed3325148651678","scripts":{"push":"npm run push:git && npm run push:npm","test":"mocha tests/**/*.js","release":"npm version patch && npm run push","push:git":"git push origin main","push:npm":"npm publish --registry https://registry.npmjs.org --access public"},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"repository":{"url":"git+https://github.com/azsxdc12356/eslint-plugin-vue-ref-value.git","type":"git"},"_npmVersion":"10.1.0","description":"ESLint plugin to detect missing .value when using Vue ref variables","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.0.0","eslint":"^8.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-vue-ref-value_1.0.4_1776260163870_0.05795655681344081","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.5","keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.5","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"homepage":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value#readme","bugs":{"url":"https://github.com/azsxdc12356/eslint-plugin-vue-ref-value/issues"},"dist":{"shasum":"496fb13470dee6d446375500df494de7d6600a0c","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.5.tgz","fileCount":7,"integrity":"sha512-BZmOU+tNiuMwMug0iaSm3OOiBizmQqY7TqakWmdaMBlLrOlEXdka0wnt+WF1LndQjGBEgsNj5nPnaNMQA/P4ZQ==","signatures":[{"sig":"MEUCIBlVsI9+jH0LLgqUmb2VR7MxFVM/zW1uMmEcYBDpKvHsAiEAmV4U4JJDyglE1x1TeswcCBYMk9Dblzcy6Z0STM1G7aI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29666},"main":"src/index.js","type":"commonjs","gitHead":"46c4bd4cb2f9601d6a02b3e90b878d2e2865b566","scripts":{"push":"npm run push:git && npm run push:npm","test":"mocha tests/**/*.js","release":"npm version patch && npm run push","push:git":"git push origin main","push:npm":"npm publish --registry https://registry.npmjs.org --access public"},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"repository":{"url":"git+https://github.com/azsxdc12356/eslint-plugin-vue-ref-value.git","type":"git"},"_npmVersion":"10.1.0","description":"ESLint plugin to detect missing .value when using Vue ref variables","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.0.0","eslint":"^8.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-vue-ref-value_1.0.5_1776358039985_0.7746468830287783","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@azsxdc12356/eslint-plugin-vue-ref-value","version":"1.0.6","description":"ESLint plugin to detect missing .value when using Vue ref variables","main":"src/index.js","type":"commonjs","scripts":{"test":"mocha tests/**/*.js","push:git":"git push origin main","push:npm":"npm publish --registry https://registry.npmjs.org --access public","push":"npm run push:git && npm run push:npm","release":"npm version patch && npm run push"},"keywords":["eslint","eslintplugin","vue","ref","value"],"author":{"name":"Junjie"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/junjie-z666/eslint-plugin-vue-ref-value.git"},"devDependencies":{"eslint":"^8.0.0","mocha":"^10.0.0"},"peerDependencies":{"eslint":">=8.0.0"},"_id":"@azsxdc12356/eslint-plugin-vue-ref-value@1.0.6","gitHead":"d968cce76447b981f6a41e192909c5b6ac23b72a","bugs":{"url":"https://github.com/junjie-z666/eslint-plugin-vue-ref-value/issues"},"homepage":"https://github.com/junjie-z666/eslint-plugin-vue-ref-value#readme","_nodeVersion":"22.14.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-HGeOyo4Na+JN6G3gbXApXaP8CrdjHCyn0ZneRKwD9qWiwcGam57vRwFtCziyE7FCylF8+Vu1JWJbQTXca0xTog==","shasum":"b81d94dbcd3af667116428abc988a8c0390e1c7d","tarball":"https://registry.npmjs.org/@azsxdc12356/eslint-plugin-vue-ref-value/-/eslint-plugin-vue-ref-value-1.0.6.tgz","fileCount":8,"unpackedSize":29908,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC1QWxl3MFOXHLn8fgCDSSZVSrKM9HWdaCfatONYeW19QIhAP2MZKB/HaCpQScUJZJT8kOalJXNUU4a0awu8V89MIy1"}]},"_npmUser":{"name":"azsxdc12356","email":"527759787@qq.com"},"directories":{},"maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-vue-ref-value_1.0.6_1777566401960_0.8060243675994427"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-09T17:41:05.652Z","modified":"2026-04-30T16:26:42.212Z","1.0.0":"2026-04-09T17:41:05.914Z","1.0.1":"2026-04-09T18:03:02.339Z","1.0.2":"2026-04-09T18:12:36.319Z","1.0.3":"2026-04-14T15:23:53.054Z","1.0.4":"2026-04-15T13:36:04.021Z","1.0.5":"2026-04-16T16:47:20.187Z","1.0.6":"2026-04-30T16:26:42.112Z"},"bugs":{"url":"https://github.com/junjie-z666/eslint-plugin-vue-ref-value/issues"},"author":{"name":"Junjie"},"license":"MIT","homepage":"https://github.com/junjie-z666/eslint-plugin-vue-ref-value#readme","keywords":["eslint","eslintplugin","vue","ref","value"],"repository":{"type":"git","url":"git+https://github.com/junjie-z666/eslint-plugin-vue-ref-value.git"},"description":"ESLint plugin to detect missing .value when using Vue ref variables","maintainers":[{"name":"azsxdc12356","email":"527759787@qq.com"}],"readme":"# eslint-plugin-vue-ref-value\n\nESLint 插件，用于检测 Vue2 项目中使用 `ref` 定义的变量在实际使用时未使用 `.value` 的问题。\n\n## 安装\n\n```bash\n# npm\nnpm install @azsxdc12356/eslint-plugin-vue-ref-value --save-dev\n\n# yarn\nyarn add @azsxdc12356/eslint-plugin-vue-ref-value -D\n\n# pnpm\npnpm add @azsxdc12356/eslint-plugin-vue-ref-value -D\n```\n\n## 使用\n\n### ESLint 9+（推荐）\n\n```js\n// eslint.config.js\nconst vueRefValue = require('@azsxdc12356/eslint-plugin-vue-ref-value');\n\nmodule.exports = [\n  {\n    plugins: {\n      '@azsxdc12356/vue-ref-value': vueRefValue\n    },\n    rules: {\n      '@azsxdc12356/vue-ref-value/require-ref-value': 'error'\n    }\n  }\n];\n```\n\n### ESLint 8 及以下\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  plugins: ['@azsxdc12356/vue-ref-value'],\n  rules: {\n    '@azsxdc12356/vue-ref-value/require-ref-value': 'error'\n  }\n}\n```\n\n## 已知限制\n\n### 跨文件 ref 变量检测\n\nESLint 是静态分析工具，只能分析当前文件的作用域。**无法检测从其他文件导入的 ref 变量**：\n\n```js\n// useCounter.js\nexport function useCounter() {\n  const count = ref(0);\n  return { count };  // 返回 ref 变量\n}\n\n// MyComponent.vue\nimport { useCounter } from './useCounter';\nconst { count } = useCounter();\n\nconsole.log(count);  // ❌ 检测不到 count 是 ref，不会报错！\n```\n\n**解决方案：**\n1. **使用命名约定**（推荐）：配置 `namingConventions: ['Ref']`，使用 `countRef` 命名\n2. **类型标注**：使用 TypeScript 配合类型检查\n\n## 功能特性\n\n### 自动跳过检测的场景\n\n| 场景 | 说明 |\n|------|------|\n| `.value` 访问 | `count.value` ✅ |\n| Vue 模板 | `<template>` 中自动解包 |\n| 返回值 | `return count`、`return { count }`、`return [count]` |\n| reactive 对象 | `reactive({ count: ref(0) })` 中的 `state.count` |\n| 白名单函数 | `watch(count, ...)`、`isRef(count)` 等 |\n| 作用域遮蔽 | 局部同名变量遮蔽外部 ref |\n\n### 白名单函数\n\n默认允许直接传入 ref 的函数：\n\n`watch`、`watchEffect`、`watchPostEffect`、`watchSyncEffect`、`isRef`、`unref`、`toRef`、`toRefs`、`toValue`、`triggerRef`、`shallowRef`、`computed`、`readonly`、`markRaw`、`ref`、`inject`、`provide`\n\n### 自定义白名单\n\n```js\nrules: {\n  '@azsxdc12356/vue-ref-value/require-ref-value': ['error', {\n    allowlistFunctions: ['myCustomFunction']\n  }]\n}\n```\n\n### 命名约定检测（跨文件 ref 变量）\n\n对于从其他文件导入的 ref 变量（如 composables），由于 ESLint 无法跨文件分析，可以通过**命名约定**来检测：\n\n```js\n// eslint.config.js\nmodule.exports = {\n  rules: {\n    '@azsxdc12356/vue-ref-value/require-ref-value': ['error', {\n      namingConventions: ['Ref', 'Computed']  // 以 Ref 或 Computed 结尾的变量需要 .value\n    }]\n  }\n};\n```\n\n**使用示例：**\n\n```js\n// useUser.js (其他文件)\nexport function useUser() {\n  const userRef = ref({ name: 'John' });  // 命名约定：以 Ref 结尾\n  return { userRef };\n}\n\n// MyComponent.vue\nimport { useUser } from './useUser';\n\nconst { userRef } = useUser();\n\nconsole.log(userRef);       // ❌ 错误：命名约定变量需要 .value\nconsole.log(userRef.value); // ✅ 正确\n\n// 函数调用不会被检测（排除 getter 函数）\nfunction getUserRef() { return ref({}); }\nconst user = getUserRef();  // ✅ 正确：函数调用不受命名约定影响\n```\n\n**命名约定规则：**\n- 变量名以指定后缀结尾（如 `userRef`, `totalComputed`）\n- **排除函数调用**：`getUserRef()` 不会被检测\n- 遵循其他所有规则（白名单、返回值、defineExpose 等）\n\n## 示例\n\n### 基本用法\n\n```js\nimport { ref } from 'vue';\n\nconst count = ref(0);\n\nconsole.log(count);        // ❌ 错误：缺少 .value\nconsole.log(count.value);  // ✅ 正确\ncount.value = 1;           // ✅ 正确：赋值\n\nif (count > 0) { }         // ❌ 错误\nif (count.value > 0) { }   // ✅ 正确\n```\n\n### 别名导入\n\n```js\nimport { ref as r } from 'vue';\n\nconst count = r(0);\nconsole.log(count);        // ❌ 错误\nconsole.log(count.value);  // ✅ 正确\n```\n\n### Vue 模板自动解包\n\n```vue\n<template>\n  <div>{{ count }}</div>   <!-- ✅ 正确：template 中自动解包 -->\n</template>\n\n<script>\nimport { ref } from 'vue';\n\nexport default {\n  setup() {\n    const count = ref(0);\n    console.log(count);        // ❌ 错误：script 中需要 .value\n    console.log(count.value);  // ✅ 正确\n    return { count };          // ✅ 正确：返回值\n  }\n}\n</script>\n```\n\n### 白名单函数\n\n```js\nimport { ref, watch, isRef, unref } from 'vue';\n\nconst count = ref(0);\n\nwatch(count, () => {});   // ✅ 正确\nisRef(count);              // ✅ 正确\nunref(count);              // ✅ 正确\n```\n\n### 返回值\n\n```js\nimport { ref } from 'vue';\n\nfunction useCounter() {\n  const count = ref(0);\n  return count;           // ✅ 正确：直接返回\n}\n\nfunction useCounter() {\n  const count = ref(0);\n  return { count };       // ✅ 正确：返回对象\n}\n\nfunction useCounter() {\n  const count = ref(0);\n  return [count];         // ✅ 正确：返回数组\n}\n\nfunction useCounter() {\n  const count = ref(0);\n  return count + 1;       // ❌ 错误：参与运算需要 .value\n}\n```\n\n### reactive 自动解包\n\n```js\nimport { ref, reactive } from 'vue';\n\nconst count = ref(0);\nconst state = reactive({ count });\n\nconsole.log(state.count);  // ✅ 正确：reactive 自动解包\nstate.count = 1;           // ✅ 正确\n\n// 别名导入\nimport { reactive as r } from 'vue';\nconst state2 = r({ count: ref(0) });\nconsole.log(state2.count); // ✅ 正确\n```\n\n### 作用域遮蔽\n\n```js\nimport { ref } from 'vue';\n\nconst count = ref(0);\n\nfunction test() {\n  const count = 123;       // 局部变量遮蔽外部 ref\n  console.log(count);      // ✅ 正确：这是局部变量\n}\n\nfunction test(count) {     // 参数遮蔽\n  return count;            // ✅ 正确：这是参数\n}\n\nconsole.log(count);        // ❌ 错误：外部的 ref 需要 .value\n```\n\n### 自定义白名单\n\n```js\n// eslint.config.js\nmodule.exports = {\n  rules: {\n    '@azsxdc12356/vue-ref-value/require-ref-value': ['error', {\n      allowlistFunctions: ['myCustomFunction']\n    }]\n  }\n};\n\n// 代码中\nimport { ref } from 'vue';\n\nconst count = ref(0);\nmyCustomFunction(count);   // ✅ 正确：自定义白名单\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}