{"_id":"@allahjs/eslint","_rev":"4-90ccdbd2ff6d7ddd776345ca912ceaf6","name":"@allahjs/eslint","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@allahjs/eslint","version":"0.0.1","keywords":["eslint","prettier","antd","ant","design","pro"],"author":{"name":"qixian.cs@outlook.com"},"license":"ISC","_id":"@allahjs/eslint@0.0.1","maintainers":[{"name":"allahbin","email":"569693942@qq.com"},{"name":"allahbin2","email":"allahbin1996@gmail.com"}],"homepage":"https://github.com/allah-prime/allah-eslint#readme","bugs":{"url":"https://github.com/allah-prime/allah-eslint/issues"},"dist":{"shasum":"f7ee951ffb830f453355a946e3082cd481cc30ac","tarball":"https://registry.npmjs.org/@allahjs/eslint/-/eslint-0.0.1.tgz","fileCount":8,"integrity":"sha512-6p/Zh6xovIgCzVltIkB2g8laGIkMlggC280tSafdGSvJUnVGaK10Iq2+PER7DvHcxE2w8YaDG7OFiZRHn6ljsw==","signatures":[{"sig":"MEUCIQC6WvaQ1p2nRyuFujBSL+WRKVF53jlWH/Ds6X6syONRHgIgCEx4y2luPB45ErUjCYeGWGFl5BnFVa48fANfXjCqMqE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14846},"main":"dist/index.js","pnpm":{"overrides":{"eslint":"9.39.2"}},"type":"module","types":"dist/index.d.ts","gitHead":"d60ce846e37dda1ecf0df985721369fcbb0922c0","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"allahbin2","email":"allahbin1996@gmail.com"},"repository":{"url":"git+https://github.com/allah-prime/allah-eslint.git","type":"git"},"_npmVersion":"11.8.0","description":"My shared ESLint & Prettier configuration for projects","directories":{},"_nodeVersion":"24.13.1","dependencies":{"globals":"17.0.0","@eslint/js":"9.39.2","typescript":"5.9.3","@eslint/compat":"2.0.0","eslint-plugin-vue":"10.6.2","typescript-eslint":"8.52.0","eslint-plugin-react":"7.37.5","eslint-config-prettier":"10.1.8","eslint-plugin-react-hooks":"7.0.1","eslint-plugin-unused-imports":"4.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.1.0","devDependencies":{"jiti":"2.6.1","eslint":"9.39.2","vitest":"4.0.16","@types/node":"25.0.3","semantic-release":"^25.0.3"},"peerDependencies":{"eslint":"9.39.2","prettier":"3.7.4"},"_npmOperationalInternal":{"tmp":"tmp/eslint_0.0.1_1771224005174_0.7377378355584316","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@allahjs/eslint","version":"0.0.2","keywords":["eslint","prettier","antd","ant","design","pro"],"author":{"name":"qixian.cs@outlook.com"},"license":"ISC","_id":"@allahjs/eslint@0.0.2","maintainers":[{"name":"allahbin","email":"569693942@qq.com"},{"name":"allahbin2","email":"allahbin1996@gmail.com"}],"homepage":"https://github.com/allah-prime/allah-eslint#readme","bugs":{"url":"https://github.com/allah-prime/allah-eslint/issues"},"dist":{"shasum":"79ea69abb0aea1dd33add30ab168d6293c4f05e1","tarball":"https://registry.npmjs.org/@allahjs/eslint/-/eslint-0.0.2.tgz","fileCount":8,"integrity":"sha512-9CVTMtyU5YBjF/m/QaApRuuttFW6PeYwAZ/ctFw/Xa65zcKw7QWuH/3by7pk2jHthLM0ttucdp0ebqMANlrKhA==","signatures":[{"sig":"MEYCIQCWskwWdrosFkx7P676ixvwCSm3Uvvm8l1y0fwbFLmXvgIhAJz3M+CLIXCRkyybInef2a9gjW6xfPEFpTXyNSRbnXGd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@allahjs%2feslint@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14444},"main":"dist/index.js","type":"module","_from":"file:allahjs-eslint-0.0.2.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest","build":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f72fd27e-41cc-4876-ab98-c1ceb773cdc0"}},"_resolved":"/tmp/ae429747d5a64113ebb3f087e7d9e161/allahjs-eslint-0.0.2.tgz","_integrity":"sha512-9CVTMtyU5YBjF/m/QaApRuuttFW6PeYwAZ/ctFw/Xa65zcKw7QWuH/3by7pk2jHthLM0ttucdp0ebqMANlrKhA==","repository":{"url":"git+https://github.com/allah-prime/allah-eslint.git","type":"git"},"_npmVersion":"11.6.2","description":"My shared ESLint & Prettier configuration for projects","directories":{},"_nodeVersion":"24.13.0","dependencies":{"globals":"17.0.0","@eslint/js":"9.39.2","typescript":"5.9.3","@eslint/compat":"2.0.0","eslint-plugin-vue":"10.6.2","typescript-eslint":"8.52.0","eslint-plugin-react":"7.37.5","eslint-config-prettier":"10.1.8","eslint-plugin-react-hooks":"7.0.1","eslint-plugin-unused-imports":"4.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"2.6.1","eslint":"9.39.2","vitest":"4.0.16","@types/node":"25.0.3","semantic-release":"^25.0.3"},"peerDependencies":{"eslint":"9.39.2","prettier":"3.7.4"},"_npmOperationalInternal":{"tmp":"tmp/eslint_0.0.2_1771225368169_0.5367395216499475","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@allahjs/eslint","version":"0.0.3","keywords":["eslint","prettier","antd","ant","design","pro"],"author":{"name":"qixian.cs@outlook.com"},"license":"ISC","_id":"@allahjs/eslint@0.0.3","maintainers":[{"name":"allahbin","email":"569693942@qq.com"},{"name":"allahbin2","email":"allahbin1996@gmail.com"}],"homepage":"https://github.com/allah-prime/allah-eslint#readme","bugs":{"url":"https://github.com/allah-prime/allah-eslint/issues"},"dist":{"shasum":"6ecd2f61f6080ed4f0bb8b30f855273dcfa9eb15","tarball":"https://registry.npmjs.org/@allahjs/eslint/-/eslint-0.0.3.tgz","fileCount":8,"integrity":"sha512-X5aMvo2/6OLPm3Tju2A/8mVh0d8B0l54BrYQBQY0FmQcV4qzW8j5j+h3lVneWUd77ZgyjUbZN7WTh2H+hN6DiA==","signatures":[{"sig":"MEUCIQCqsLYXfzXElaq1ns1WxyO3ioXgZd5EzZo+e6aGeng0AQIgfk6M0Jz93mjtgriGtijCN7ehOaewTSJhRPcf5XzTRHM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@allahjs%2feslint@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14106},"main":"dist/index.js","type":"module","_from":"file:allahjs-eslint-0.0.3.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest","build":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f72fd27e-41cc-4876-ab98-c1ceb773cdc0"}},"_resolved":"/tmp/0dc786f9c45a196ef9b5643a92419f68/allahjs-eslint-0.0.3.tgz","_integrity":"sha512-X5aMvo2/6OLPm3Tju2A/8mVh0d8B0l54BrYQBQY0FmQcV4qzW8j5j+h3lVneWUd77ZgyjUbZN7WTh2H+hN6DiA==","repository":{"url":"git+https://github.com/allah-prime/allah-eslint.git","type":"git"},"_npmVersion":"11.6.2","description":"My shared ESLint & Prettier configuration for projects","directories":{},"_nodeVersion":"24.13.0","dependencies":{"globals":"17.0.0","@eslint/js":"9.39.2","typescript":"5.9.3","@eslint/compat":"2.0.0","eslint-plugin-vue":"10.6.2","typescript-eslint":"8.52.0","eslint-plugin-react":"7.37.5","eslint-config-prettier":"10.1.8","eslint-plugin-react-hooks":"7.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"2.6.1","eslint":"9.39.2","vitest":"4.0.16","@types/node":"25.0.3","semantic-release":"^25.0.3"},"peerDependencies":{"eslint":"9.39.2","prettier":"3.7.4"},"_npmOperationalInternal":{"tmp":"tmp/eslint_0.0.3_1771242115353_0.1827838467076246","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@allahjs/eslint","version":"1.0.1","packageManager":"pnpm@9.1.0","type":"module","description":"My shared ESLint & Prettier configuration for projects","repository":{"type":"git","url":"git+https://github.com/allah-prime/allah-eslint.git"},"keywords":["eslint","prettier","antd","ant","design","pro"],"license":"ISC","author":{"name":"qixian.cs@outlook.com"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"pnpm run build"},"publishConfig":{"access":"public"},"pnpm":{"overrides":{"eslint":"9.39.2"}},"dependencies":{"@eslint/compat":"2.0.0","@eslint/js":"9.39.2","eslint-config-prettier":"10.1.8","eslint-plugin-react":"7.37.5","eslint-plugin-react-hooks":"7.0.1","eslint-plugin-vue":"10.6.2","globals":"17.0.0","typescript":"5.9.3","typescript-eslint":"8.52.0"},"peerDependencies":{"eslint":"9.39.2","prettier":"3.7.4"},"devDependencies":{"@types/node":"25.0.3","eslint":"9.39.2","jiti":"2.6.1","semantic-release":"^25.0.3","vitest":"4.0.16"},"gitHead":"075111620980b33d4c53fd1867f5fb38018d6b16","_id":"@allahjs/eslint@1.0.1","bugs":{"url":"https://github.com/allah-prime/allah-eslint/issues"},"homepage":"https://github.com/allah-prime/allah-eslint#readme","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-d6sBTP9K6mmvM/nvTec6Fny0Y8ukwHUoT+wubFy4YaFBhEG4iMZV/pVfFdKdQXLkUAN5zTBH8JGwmBDUWMZKWA==","shasum":"96de8d3c66b103e412504f252862402fb0e3ba2a","tarball":"https://registry.npmjs.org/@allahjs/eslint/-/eslint-1.0.1.tgz","fileCount":8,"unpackedSize":14248,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@allahjs%2feslint@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGJtyHxemO+LsyzClMYeUFAZeD5oOE+oeBM0KfrvdYrNAiEA7dBWCUWGK/TISQz3zEmZQjwp8aEkAW2UrO2jX8QGcG8="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f72fd27e-41cc-4876-ab98-c1ceb773cdc0"}},"directories":{},"maintainers":[{"name":"allahbin","email":"569693942@qq.com"},{"name":"allahbin2","email":"allahbin1996@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint_1.0.1_1771242128130_0.9134523785772699"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-16T06:40:04.820Z","modified":"2026-02-16T11:42:08.608Z","0.0.1":"2026-02-16T06:40:05.326Z","0.0.2":"2026-02-16T07:02:48.323Z","0.0.3":"2026-02-16T11:41:55.504Z","1.0.1":"2026-02-16T11:42:08.282Z"},"bugs":{"url":"https://github.com/allah-prime/allah-eslint/issues"},"author":{"name":"qixian.cs@outlook.com"},"license":"ISC","homepage":"https://github.com/allah-prime/allah-eslint#readme","keywords":["eslint","prettier","antd","ant","design","pro"],"repository":{"type":"git","url":"git+https://github.com/allah-prime/allah-eslint.git"},"description":"My shared ESLint & Prettier configuration for projects","maintainers":[{"name":"allahbin","email":"569693942@qq.com"},{"name":"allahbin2","email":"allahbin1996@gmail.com"}],"readme":"# @allah/eslint\n\nMy shared ESLint & Prettier configuration for projects.\n这是一个基于 ESLint 9+ 和 Prettier 的共享配置包，提供了 React 和 Vue 的开箱即用配置。\n\n## 核心特性\n\n- **TypeScript**: 完整的类型检查支持。\n- **Prettier**: 集成 Prettier 用于代码格式化，通过 `eslint-config-prettier` 解决冲突。\n- **React**: 包含 Hooks 和 JSX 的最佳实践。\n- **Vue**: 支持 Vue 3 + TypeScript。\n\n## 参考文档\n\n本项目配置参考了以下官方文档：\n\n- [ESLint Shareable Configs](https://eslint.org/docs/latest/extend/shareable-configs)\n- [ESLint Rules](https://eslint.org/docs/latest/rules/)\n- [TypeScript ESLint Rules](https://typescript-eslint.io/rules/)\n- [React Plugin Rules](https://github.com/jsx-eslint/eslint-plugin-react)\n- [Vue Plugin Rules](https://eslint.vuejs.org/rules/)\n- [Prettier Options](https://prettier.io/docs/en/options.html)\n\n---\n\n## 使用指南\n\n### 1. 安装依赖\n\n```bash\npnpm add -D eslint prettier @allah/eslint\n```\n\n### 2. 配置 Prettier\n\n建议在项目根目录下创建 `.prettierrc` 以保持格式化风格一致：\n\n```json\n{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"singleQuote\": true,\n  \"trailingComma\": \"none\",\n  \"printWidth\": 100\n}\n```\n\n### 3. 配置.editorconfig\n\n需要在项目下配置`.editorconfig`文件以保持格式化风格统一\n\n```editorconfig\n# http://editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n\n[Makefile]\nindent_style = tab\n```\n\n### 3. 配置 ESLint\n\n根据你的项目类型选择对应的配置。\n\n#### 🅰️ React + TypeScript 项目\n\n在项目根目录下创建 `eslint.config.js`：\n\n```javascript\nimport allahConfig from '@allah/eslint';\n\nexport default [\n  ...allahConfig,\n  {\n    files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],\n    rules: {\n      camelcase: 0\n    }\n  }\n];\n```\n\n#### 🅱️ Vue 3 + TypeScript 项目\n\n在项目根目录下创建 `eslint.config.js`，注意引入路径为 `@allah/eslint/dist/vue`：\n\n```javascript\nimport allahConfig from '@allah/eslint/dist/vue';\n\nexport default defineConfig([\n  ...allahConfig,\n  {\n    files: ['**/*.{js,mjs,cjs,ts,vue}'],\n    rules: {\n      // 要求使用模板字面量而非字符串连接\n      'prefer-template': 2\n    }\n  }\n]);\n```\n\n### 4. VSCode 配置推荐\n\n为了获得最佳的开发体验，建议在 `.vscode/settings.json` 中添加以下配置，实现保存自动格式化和修复：\n\n```json\n{\n  \"editor.formatOnSave\": true,\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll.eslint\": \"explicit\"\n  },\n  \"eslint.validate\": [\"javascript\", \"javascriptreact\", \"typescript\", \"typescriptreact\", \"vue\"]\n}\n```\n\n#### 自定义的示例\n\n你有也可以自定义对eslint的规则进行配置，示例如下\n\n```ts\nimport js from '@eslint/js';\nimport globals from 'globals';\nimport reactPlugin from 'eslint-plugin-react';\nimport reactHooks from 'eslint-plugin-react-hooks';\n\nexport default [\n  // 1. 忽略文件\n  {\n    ignores: [\n      'dist',\n      'node_modules',\n      'lambda',\n      'scripts',\n      'config',\n      '.history',\n      'public',\n      '.umi',\n      'mock',\n      'service.js',\n      'es',\n      'lib'\n    ]\n  },\n\n  // 2. 基础配置 + React 配置\n  {\n    files: ['**/*.{ts,tsx,mjs,cjs}'],\n    languageOptions: {\n      ecmaVersion: 'latest',\n      sourceType: 'module',\n      // 必须开启 JSX 解析\n      parserOptions: {\n        ecmaFeatures: {\n          jsx: true\n        }\n      },\n      globals: {\n        ...globals.browser,\n        ...globals.node\n      }\n    },\n    // 注册插件\n    plugins: {\n      react: reactPlugin,\n      'react-hooks': reactHooks\n    },\n    rules: {\n      // --- 基础规则 ---\n      ...js.configs.recommended.rules,\n      'prefer-template': 'error', // 你的核心需求\n\n      // --- React 规则 ---\n      ...reactPlugin.configs.recommended.rules,\n      ...reactPlugin.configs['jsx-runtime'].rules, // 如果你使用 React 17+ (不需要手动 import React)\n\n      // --- React Hooks 规则 ---\n      ...reactHooks.configs.recommended.rules,\n\n      // 自定义调整\n      'react/prop-types': 'off' // 如果你觉得写 PropTypes 太麻烦可以关掉\n    },\n    // 自动检测 React 版本\n    settings: {\n      react: {\n        version: 'detect'\n      }\n    }\n  }\n];\n```\n","readmeFilename":"README.md"}