{"id":16513217,"url":"https://github.com/youngjuning-archive/eslint-config","last_synced_at":"2025-07-31T03:33:10.157Z","repository":{"id":57169862,"uuid":"281883689","full_name":"youngjuning-archive/eslint-config","owner":"youngjuning-archive","description":"A powerful esLint config based on airbnb","archived":false,"fork":false,"pushed_at":"2021-07-17T09:21:22.000Z","size":96,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-10T17:52:59.686Z","etag":null,"topics":["airbnb","react","react-native","typescript","vue"],"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/youngjuning-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-07-23T07:35:31.000Z","updated_at":"2024-05-15T09:21:57.000Z","dependencies_parsed_at":"2022-08-27T12:01:43.747Z","dependency_job_id":null,"html_url":"https://github.com/youngjuning-archive/eslint-config","commit_stats":null,"previous_names":["youngjuning/eslint-config"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngjuning-archive%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngjuning-archive%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngjuning-archive%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngjuning-archive%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youngjuning-archive","download_url":"https://codeload.github.com/youngjuning-archive/eslint-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219866275,"owners_count":16555907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["airbnb","react","react-native","typescript","vue"],"created_at":"2024-10-11T16:08:10.342Z","updated_at":"2024-10-11T16:08:11.585Z","avatar_url":"https://github.com/youngjuning-archive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @youngjuning/eslint-config\n\na powerful esLint config based on airbnb\n\n\u003e Please remove your eslint、prettier plugin first. All in @youngjuning/eslint-config\n\n## Prettier\n\nDependencies:\n\n```sh\n$ yarn add @youngjuning/prettier-config -D\n```\n\nConfig:\n\n```js\n// .prettierrc.js\nmodule.exports = require('@youngjuning/prettier-config');\n```\n\n## Base\n\n\u003e support .js、.ts\n\nDependencies:\n\n```sh\n$ yarn add -D @youngjuning/eslint-config\n```\n\nConfig:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  extends: ['@youngjuning/eslint-config']\n}\n```\n\n## React\n\n\u003e support .js、.ts、.jsx、.tsx、.html\n\nDependencies:\n\n```sh\n$ yarn add -D eslint-plugin-react \\\n  eslint-plugin-react-hooks \\\n  eslint-plugin-jsx-a11y \\\n  eslint-plugin-import\n```\n\nConfig:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  extends: ['@youngjuning/eslint-config/react']\n}\n```\n\n## React Native\n\n\u003e support .js、.ts、.jsx、.tsx\n\nDependencies:\n\n```sh\n$ yarn add -D eslint-plugin-react \\\n  eslint-plugin-react-hooks \\\n  eslint-plugin-jsx-a11y \\\n  eslint-plugin-import \\\n  eslint-plugin-react-native\n```\n\nConfig:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  extends: ['@youngjuning/eslint-config/react-native']\n}\n```\n\n## Vue\n\n\u003e support .js、.ts、.vue\n\nDependencies:\n\n```sh\n$ yarn add -D @vue/cli-service eslint-plugin-vue @vue/eslint-config-airbnb\n```\n\nConfig:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  extends: ['@youngjuning/eslint-config/vue']\n}\n```\n\n## miniprogram\n\n\u003e support .js、.ts\n\nConfig:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  extends: ['@youngjuning/eslint-config/miniprogram']\n}\n```\n\n## html\n\n\u003e support .js、.ts、.html\n\nDependencies:\n\n```sh\n$ yarn add -D eslint-plugin-html\n```\n\nConfig:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  extends: [...,'@youngjuning/eslint-config/html']\n}\n```\n\n## More Config\n\n### .eslintignore\n\n```\n!.eslintrc.js\n!.prettierrc.js\n```\n\n### .editorconfig\n\n```\n# EditorConfig is awesome: http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines with a newline ending every file\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\nquote_type = single\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n\n[*.gradle]\nindent_size = 4\n\n[BUCK]\nindent_size = 4\n```\n\n### husky \u0026 lint-staged\n\n```sh\n$ yarn add -D husky lint-staged\n```\n\n```json\n{\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"lint-staged\"\n    }\n  },\n  \"lint-staged\": {\n    \"**/*.{js,jsx,ts,tsx}\": [\n      \"eslint --fix\",\n      \"git add\"\n    ],\n    // you can add wxml/html...\n    \"**/*.{less,md,json}\": [\n      \"prettier --write\",\n      \"git add\"\n    ]\n  },\n}\n```\n\n### vscode eslint 配置\n\n禁用 formatOnSave，开启 source.fixAll.eslint\n\n```json\n{\n  \"editor.formatOnSave\": false,\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll.eslint\": true\n  },\n  // 建议直接删掉 Prettier 插件\n  \"prettier.disableLanguages\": [\n    \"javascript\",\n    \"javascriptreact\",\n    \"typescript\",\n    \"typescriptreact\",\n    \"vue\"\n  ],\n}\n```\n\n### git autocrlf\n\n为了解决换行符冲突的问题，强烈建议设置 `core.autocrlf` 为 `input`。为什么这么做请读一下 [Git 多平台换行符问题(LF or CRLF)](https://blog.konghy.cn/2017/03/19/git-lf-or-crlf/)\n\n```sh\n$ git config --global core.autocrlf input\n```\n\n## Related repos\n\n- [@youngjuning/prettier-config](https://github.com/youngjuning/prettier-config)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungjuning-archive%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoungjuning-archive%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungjuning-archive%2Feslint-config/lists"}