{"id":42048874,"url":"https://github.com/mirreal/code-guide","last_synced_at":"2026-01-26T06:32:36.729Z","repository":{"id":57228564,"uuid":"118898260","full_name":"mirreal/code-guide","owner":"mirreal","description":"JavaScript Code Guide","archived":false,"fork":false,"pushed_at":"2018-02-06T13:49:59.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T12:55:48.711Z","etag":null,"topics":["code-guide","ecmascript","es2015","eslint","eslint-config","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mirreal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-25T10:24:53.000Z","updated_at":"2018-01-27T16:27:17.000Z","dependencies_parsed_at":"2022-09-14T07:40:46.420Z","dependency_job_id":null,"html_url":"https://github.com/mirreal/code-guide","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mirreal/code-guide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirreal%2Fcode-guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirreal%2Fcode-guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirreal%2Fcode-guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirreal%2Fcode-guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirreal","download_url":"https://codeload.github.com/mirreal/code-guide/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirreal%2Fcode-guide/sbom","scorecard":{"id":649335,"data":{"date":"2025-08-11","repo":{"name":"github.com/mirreal/code-guide","commit":"3fa3eb6d033012a326d92a5bb551fc5f5b02ceec"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T13:02:03.922Z","repository_id":57228564,"created_at":"2025-08-21T13:02:03.922Z","updated_at":"2025-08-21T13:02:03.922Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28768369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["code-guide","ecmascript","es2015","eslint","eslint-config","react"],"created_at":"2026-01-26T06:32:36.123Z","updated_at":"2026-01-26T06:32:36.718Z","avatar_url":"https://github.com/mirreal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Code Guide\n\n[![npm version](https://img.shields.io/npm/v/eslint-config-link.svg?style=flat-square)](https://www.npmjs.com/package/eslint-config-link)\n[![npm downloads](https://img.shields.io/npm/dm/eslint-config-link.svg?style=flat-square)](https://www.npmjs.com/package/eslint-config-link)\n\n## 如何使用\n\n参考：[eslint-config-link](./packages/eslint-config-link/README.md)\n\n#### 安装\n\n```sh\nnpm install eslint-config-link --save-dev\n```\n\n#### 配置\n\n.eslintrc.js\n\n```js\nmodule.exports = {\n    extends: [\n        'link'\n    ]\n}\n```\n\n## .editorconfig\n\n```\n# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 4\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n```\n\n## ESLint 详细规范\n\n最终规范以 [eslint-config-link](https://www.npmjs.com/package/eslint-config-link) 为准\n\n```js\nmodule.exports = {\n    \"rules\": {\n        // 使用 4 个空格缩进\n        \"indent\": [2, 4],\n        // 使用驼峰命名或者 UPPERCASE_WITH_UNDERSCORES\n        \"camelcase\": [2, {\"properties\": \"never\"}],\n        // 使用单引号\n        \"quotes\": [2, \"single\", {\"allowTemplateLiterals\": true}],\n        // 使用分号\n        \"semi\": [2, \"always\"],\n        // 使用 === 和 !==\n        \"eqeqeq\": [2, \"always\"],\n        // 单行可省略{}，其他情况不允许省略\n        \"curly\": [2, \"multi-line\"],\n\n        // 在条件表达式禁用赋值运算符\n        \"no-cond-assign\": 2,\n        // 禁用 console\n        \"no-console\": 2,\n        // 在条件语句禁用常量表达式\n        \"no-constant-condition\": 2,\n        // 在正则表达式禁用控制字符\n        \"no-control-regex\": 2,\n        // 禁用 debugge\n        \"no-debugger\": 2,\n        // 在函数声明禁用重复参数\n        \"no-dupe-args\": 2,\n        // 在对象字面量禁用重复 key\n        \"no-dupe-keys\": 2,\n        // 在 switch 禁用重复 case\n        \"no-duplicate-case\": 2,\n        // 在正则表达式禁用空的字符集\n        \"no-empty-character-class\": 2,\n        // 禁用空块\n        \"no-empty\": 2,\n        // 在 try 语句禁用重写异常\n        \"no-ex-assign\": 2,\n        // 禁用不必要的分号\n        \"no-extra-semi\": 2,\n        // 禁用重写函数声明\n        \"no-func-assign\": 2,\n        // 在块语句中禁用函数声明\n        \"no-inner-declarations\": 2,\n        // 在正则表达式构造函数禁用无效字符串\n        \"no-invalid-regexp\": 2,\n        // 禁用不规范的空白\n        \"no-irregular-whitespace\": 2,\n        // 禁用以函数形式调用全局 Object 属性\n        \"no-obj-calls\": 2,\n        // 在正则表达式字面量禁用连续多个空格\n        \"no-regex-spaces\": 2,\n        // 禁用稀疏数组\n        \"no-sparse-arrays\": 2,\n        // 禁用混淆多行表达式\n        \"no-unexpected-multiline\": 2,\n        // 禁用不能执行的语句\n        \"no-unreachable\": 2,\n        // 在 finally 禁用流程控制语句\n        \"no-unsafe-finally\": 2,\n        // 在需要判断 NaN 时使用 isNaN()\n        \"use-isnan\": 2,\n        // 使用 typeof 比较时必须是有效的字符串\n        \"valid-typeof\": 2,\n        // 在 case/default 中禁用此法声明\n        \"no-case-declarations\": 2,\n        // 禁用空解构模式\n        \"no-empty-pattern\": 2,\n        // 在 case 语句必须使用 break\n        \"no-fallthrough\": 2,\n        // 禁用八进制\n        \"no-octal\": 2,\n        // 禁用重新声明\n        \"no-redeclare\": 2,\n        // 禁用重写自身声明\n        \"no-self-assign\": 2,\n        // 禁用无用的 label\n        \"no-unused-labels\": 2,\n        // 禁用对变量 delete\n        \"no-delete-var\": 2,\n        // 禁用未声明的变量\n        \"no-undef\": 2,\n        // 禁用未使用的标量\n        \"no-unused-vars\": 2,\n        // 禁止混合使用 tab 和 space\n        \"no-mixed-spaces-and-tabs\": 2,\n\n        // ECMAScript 6\n        // 验证是否需要调用 super()\n        \"constructor-super\": 2,\n        // 禁止对类重新赋值\n        \"no-class-assign\": 2,\n        // 禁止对使用 const 声明的变量重新赋值\n        \"no-const-assign\": 2,\n        // 禁止类中存在相同名字的成员\n        \"no-dupe-class-members\": 2,\n        // 禁止使用 Symbol 构造函数\n        \"no-new-symbol\": 2,\n        // 禁止在 super() 前使用 this/super\n        \"no-this-before-super\": 2,\n        // 在生成器函数中需要 yield\n        \"require-yield\": 2\n\n        // code style\n        // 数组中起始位置是否需要空格\n        \"array-bracket-spacing\": [2, \"never\"],\n        // 设置{}风格\n        \"brace-style\": [2, \"1tbs\", { \"allowSingleLine\": true }],\n        // 不允许在数组或对象最后一项使用逗号\n        \"comma-dangle\": [2, \"never\"],\n        // 在分号前不适用空格，分号后使用空格\n        \"comma-spacing\": 2,\n        // 分号风格，默认放在行尾\n        \"comma-style\": 2,\n        // 在变量属性中禁用空格\n        \"computed-property-spacing\": 2,\n        // 设置对 this 的引用\n        \"consistent-this\": [2, \"that\"],\n        // 文件以新行结尾\n        \"eol-last\": 2,\n        // 在函数标识和 () 之间禁用空格\n        \"func-call-spacing\": 2,\n        // JSX 使用双引号\n        \"jsx-quotes\": [2, \"prefer-double\"],\n        // 在 key 和 value 之间的空格一个空格\n        \"key-spacing\": 2,\n        // 在关键字前后使用空格\n        \"keyword-spacing\": 2,\n        // 行注释位置（上面 ？后面）\n        // \"line-comment-position\": 2,\n        // 最深嵌套 4 层\n        \"max-depth\": [2, { \"max\": 4 }],\n        // 最大行长\n        \"max-len\": [2, {\n            \"code\": 120,\n            \"ignoreUrls\": true,\n            \"ignoreStrings\": true,\n            \"ignoreTemplateLiterals\": true,\n            \"ignoreRegExpLiterals\": true\n        }],\n        // 文件最大行数\n        \"max-lines\": [2, 600],\n        // 函数最多参数\n        \"max-params\": [2, { \"max\": 8 }],\n        // 每行最大语句条数为 2\n        \"max-statements-per-line\": [2, { \"max\": 2 }],\n        // 函数最大语句条数\n        \"max-statements\": [1, { \"max\": 16 }],\n        // 使用 new 实例化对象，类名大写字母开头\n        \"new-cap\": 2,\n        // 不使用 Array 构造函数\n        \"no-array-constructor\": 2,\n        \"no-lonely-if\": 2,\n        // \"no-mixed-operators\": 0,\n        \"no-mixed-spaces-and-tabs\": 2, // eslint:recommended\n        // 最大两行空白\n        \"no-multiple-empty-lines\": [2, {\"max\": 2}],\n        // 禁用多个空格\n        \"no-multi-spaces\": 2,\n        // 禁用 Object 构造函数\n        \"no-new-object\": 2,\n        // 禁用 tabs\n        \"no-tabs\": 2,\n        // 禁用行末额外的空白\n        \"no-trailing-spaces\": 2,\n        // 禁用不需要的三元表达式\n        \"no-unneeded-ternary\": 2,\n        // 属性前没有空白\n        \"no-whitespace-before-property\": 2,\n        // 在对象 {} 中使用空格\n        \"object-curly-spacing\": [2, \"always\"],\n        // 单独使用声明\n        \"one-var\": [2, {\n            \"var\": \"never\",\n            \"let\": \"never\",\n            \"const\": \"never\",\n        }],\n        // 在块中禁用大量空白填充\n        \"padded-blocks\": [2, \"never\"],\n        // 在需要使用引号时该对象所有属性都使用引号\n        \"quote-props\": [2, \"consistent\"],\n        // 需要使用 JSDoc\n        \"require-jsdoc\": [2, {\n            \"require\": {\n                \"FunctionDeclaration\": true,\n                \"MethodDefinition\": false,\n                \"ClassDeclaration\": false,\n            },\n        }],\n        // 配置 JSDoc 规则\n        \"valid-jsdoc\": [2, {\n            \"requireParamDescription\": false,\n            \"requireReturnDescription\": false,\n            \"requireReturn\": false,\n            \"prefer\": {\"returns\": \"return\"},\n        }],\n        \"semi-spacing\": [2, {\n            \"before\": false,\n            \"after\": true\n        }],\n        // 在块语句前使用空格\n        \"space-before-blocks\": 2,\n        // 在函数声明后禁用空格\n        \"space-before-function-paren\": [2, \"never\"],\n        // 在中缀操作符之间需要空格\n        \"space-infix-ops\": [2, {\"int32Hint\": false}],\n        // 在一元运算符前后禁用空格\n        \"space-unary-ops\": 2,\n        // 在括号首尾禁用空格\n        \"space-in-parens\": 2,\n        // 在注释后使用空格\n        \"spaced-comment\": [2, \"always\"],\n\n        // ES6\n        // 设置箭头函数体风格，仅需要使用 return\n        \"arrow-body-style\": [2, \"as-needed\"],\n        // 箭头函数仅在需要时使用 ()\n        \"arrow-parens\": [2, \"as-needed\"],\n        // 箭头函数在 =\u003e 前后需要空格\n        \"arrow-spacing\": 2,\n        // 设置生成器 * 风格，仅在 * 后面使用空格\n        \"generator-star-spacing\": [2, \"after\"],\n        // 禁止多次 import 统一模块\n        \"no-duplicate-imports\": 2,\n        // 在对象字面量对不需要计算的属性禁用 []\n        \"no-useless-computed-key\": 2,\n        // 禁用不必要的构造函数\n        \"no-useless-constructor\": 2,\n        // 建议在回调函数使用箭头函数\n        // \"prefer-arrow-callback\": 2,\n        // 优先使用 const 声明\n        \"prefer-const\": 2,\n        // 建议使用 `...` 代替 `arguments`\n        \"prefer-rest-params\": 2,\n        //  Prefer the use of the spread operator ... to call variadic functions\n        \"prefer-spread\": 2,\n        // 优先使用模板字符串\n        // \"prefer-template\": 2,\n        // 设置模板字符串变量 {} 风格，不适用空格\n        \"template-curly-spacing\": 2,\n        // 使用 let 和 const 代替 var\n        // \"no-var\": 2,\n\n        // react\n        // 禁用不必要的布尔转换\n        \"no-extra-boolean-cast\": 2,\n        // 组件需要展示名字\n        \"react/display-name\": 2,\n        // 禁用重复属性\n        \"react/jsx-no-duplicate-props\": 2,\n        // 禁用未声明的组件变量\n        \"react/jsx-no-undef\": 2,\n        // Prevent React to be incorrectly marked as unused\n        \"react/jsx-uses-react\": 2,\n        // Prevent variables used in JSX to be incorrectly marked as unused\n        \"react/jsx-uses-vars\": 2,\n        // 禁用废弃的方法\n        \"react/no-deprecated\": 2,\n        // 禁止直接使用 this.state 更改状态\n        \"react/no-direct-mutation-state\": 2,\n        // 禁用 findDOMNode()\n        \"react/no-find-dom-node\": 2,\n        // 禁用 isMounted()\n        \"react/no-is-mounted\": 2,\n        // 禁用未知的 DOM 属性\n        \"react/no-unknown-property\": 2,\n        // 禁用 React.render 的返回值\n        \"react/no-render-return-value\": 2,\n        // Prevent missing React when using JSX\n        \"react/react-in-jsx-scope\": 2,\n        // 在 render() 中总是需要 return\n        \"react/require-render-return\": 2\n        // 这里关掉属性类型校验\n        \"react/prop-types\": 0,\n        // 优先使用 class extends React.Component\n        // \"react/prefer-es6-class\": 2,\n        // 没有状态的组件建议使用普通函数代替类\n        \"react/prefer-stateless-function\": 2,\n        // 使用帕斯卡命名方式对组件命名\n        \"react/jsx-pascal-case\": 2,\n        // 设置 jsx 的语法对齐和缩进\n        \"react/jsx-closing-bracket-location\": 2,\n        // 总是在自动关闭的标签前加一个空格，正常情况下也不需要换行\n        \"react/jsx-space-before-closing\": 2,\n        // 不要在JSX {} 引用括号里两边加空格\n        \"react/jsx-curly-spacing\": 2,\n        // 如果属性值为 true, 可以直接省略\n        // \"react/jsx-boolean-value\": 2,\n        // 将多行的JSX标签写在 ()\n        \"react/jsx-wrap-multilines\": 2,\n        // 对于没有子元素的标签来说总是自己关闭标签\n        // \"react/self-closing-comp\": 2,\n        // No .bind() or Arrow Functions in JSX Props\n        \"react/jsx-no-bind\": 2,\n        // 设置组件方法顺序\n        \"react/sort-comp\": 2\n    }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirreal%2Fcode-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirreal%2Fcode-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirreal%2Fcode-guide/lists"}