{"id":17298201,"url":"https://github.com/wang1212/eslint-config","last_synced_at":"2025-04-14T10:21:37.811Z","repository":{"id":37930423,"uuid":"482171032","full_name":"wang1212/eslint-config","owner":"wang1212","description":"🔧 (Config) My ESLint config. | 我的 ESLint 配置。","archived":false,"fork":false,"pushed_at":"2025-04-07T21:53:08.000Z","size":554,"stargazers_count":4,"open_issues_count":20,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T22:33:39.720Z","etag":null,"topics":["eslint-config","nodejs","prettier","react","typescript"],"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/wang1212.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-16T06:04:14.000Z","updated_at":"2024-12-19T04:23:44.000Z","dependencies_parsed_at":"2023-12-21T20:31:49.903Z","dependency_job_id":"ad23b2ca-2eaa-4db1-bfad-9cda3add1051","html_url":"https://github.com/wang1212/eslint-config","commit_stats":{"total_commits":141,"total_committers":4,"mean_commits":35.25,"dds":0.3829787234042553,"last_synced_commit":"4a2c0dfef8bc42e92f81da134241d5b92c96d61a"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":"wang1212/create-lib-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wang1212","download_url":"https://codeload.github.com/wang1212/eslint-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860006,"owners_count":21173344,"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":["eslint-config","nodejs","prettier","react","typescript"],"created_at":"2024-10-15T11:18:24.507Z","updated_at":"2025-04-14T10:21:37.787Z","avatar_url":"https://github.com/wang1212.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESLint Config\n\n\u003c!-- ![MINZIPPED SIZE](https://badgen.net/bundlephobia/minzip/@wang1212/eslint-config) --\u003e\n\n![LICENSE](https://badgen.net/github/license/wang1212/eslint-config)\n[![NPM VERSION](https://badgen.net/npm/v/@wang1212/eslint-config)](https://www.npmjs.com/package/@wang1212/eslint-config)\n![DOWNLOAD](https://badgen.net/npm/dt/@wang1212/eslint-config)\n![LAST COMMIT](https://badgen.net/github/last-commit/wang1212/eslint-config)\n![GITHUB PACKAGE CI](https://img.shields.io/github/workflow/status/wang1212/eslint-config/Node.js%20Package?label=ci/package%20publish)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a9b9c06027ba47788617123cf84d3912)](https://www.codacy.com/gh/wang1212/eslint-config/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=wang1212/eslint-config\u0026utm_campaign=Badge_Grade)\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n🔧 This package provides community-recommended [ESLint](https://eslint.org/) rules configuration as an extensible shared configuration. (Use with [Prettier](https://prettier.io/))\n\n_Support [ESLint V8](https://eslint.org/blog/2021/10/eslint-v8.0.0-released), Node.js requires version \u003e=18._\n\n## Usage\n\n```bash\nnpm install --save-dev @wang1212/eslint-config\n```\n\n1. Install `peerDependencies`:\n\n   ```bash\n   npm install --save-dev eslint\n   npm install --save-dev --save-exact prettier\n   ```\n\n2. Create a **.prettierrc.yml** file in the project root directory and configure the following:\n\n   ```yaml\n   # see docs: https://prettier.io/docs/en/configuration.html\n\n   # prettier config\n   printWidth: 80\n   tabWidth: 2\n   useTabs: false\n   singleQuote: true\n   semi: true\n   endOfLine: 'auto'\n   ```\n\n   _This is just a recommended configuration and can be adjusted to your liking._\n\n3. Then you need to add `@wang1212/eslint-config` in your **.eslintrc.json**:\n\n   ```diff\n   {\n   + \"extends\": [\"@wang1212/eslint-config\"]\n   }\n   ```\n\n   _The rule configuration of ESLint can be configured and covered according to your own requirements, please refer to the [official documentation](https://eslint.org/docs/user-guide/configuring/rules)._\n\n## Configuration Details\n\n### `@wang1212/eslint-config`\n\nThis configuration is for basic JavaScript, based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), [SonarJS](https://github.com/SonarSource/eslint-plugin-sonarjs), [JSDoc](https://jsdoc.app/), and [check API compatibility](https://github.com/amilajack/eslint-plugin-compat) with [Browserslist](https://github.com/browserslist/browserslist). (See [Source](./src/javascript.cjs))\n\n### `@wang1212/eslint-config/typescript`\n\nThis configuration is for basic [TypeScript](https://www.typescriptlang.org/), based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), [SonarJS](https://github.com/SonarSource/eslint-plugin-sonarjs), [TSDoc](https://tsdoc.org/), and [check API compatibility](https://github.com/amilajack/eslint-plugin-compat) with [Browserslist](https://github.com/browserslist/browserslist). (See [Source](./src/typescript.cjs))\n\n_This config also has an alias `@wang1212/eslint-config/ts`._\n\nUsing this configuration also requires some extra work.\n\n1. Install additional `peerDependencies`:\n\n   ```bash\n   npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin\n   ```\n\n   _**Note:** according to the official maintenance policy, the above dependencies should always be installed with the same version number._\n\n2. Then you need to add `@wang1212/eslint-config/typescript` in your **.eslintrc.json**:\n\n   ```diff\n   {\n   - \"extends\": [\"@wang1212/eslint-config\"],\n   + \"extends\": [\"@wang1212/eslint-config/typescript\"],\n   + \"parser\": \"@typescript-eslint/parser\",\n   + \"parserOptions\": {\n   +   \"project\": './tsconfig.json'\n   + },\n   }\n   ```\n\n### `@wang1212/eslint-config/react`\n\nThis configuration is for [react.js](https://reactjs.org/) applications written in JavaScript, based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), [Hooks](https://reactjs.org/docs/hooks-intro.html), [SonarJS](https://github.com/SonarSource/eslint-plugin-sonarjs), [JSDoc](https://jsdoc.app/), and [check API compatibility](https://github.com/amilajack/eslint-plugin-compat) with [Browserslist](https://github.com/browserslist/browserslist). (See [Source](./src/react.cjs))\n\nUsing this configuration also requires some extra work.\n\n- You need to add `@wang1212/eslint-config/react` in your **.eslintrc.json**:\n\n  ```diff\n  {\n  - \"extends\": [\"@wang1212/eslint-config\"],\n  + \"extends\": [\"@wang1212/eslint-config/react\"],\n  }\n  ```\n\n### `@wang1212/eslint-config/react-typescript`\n\nThis configuration is for [react.js](https://reactjs.org/) applications written in [TypeScript](https://www.typescriptlang.org/), based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), [Hooks](https://reactjs.org/docs/hooks-intro.html), [SonarJS](https://github.com/SonarSource/eslint-plugin-sonarjs), [TSDoc](https://tsdoc.org/), and [check API compatibility](https://github.com/amilajack/eslint-plugin-compat) with [Browserslist](https://github.com/browserslist/browserslist). (See [Source](./src/react-ts.cjs))\n\n_This config also has an alias `@wang1212/eslint-config/react-ts`._\n\nUsing this configuration also requires some extra work.\n\n1. Install additional `peerDependencies`:\n\n   ```bash\n   npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin\n   ```\n\n   _**Note:** according to the official maintenance policy, the above dependencies should always be installed with the same version number._\n\n2. Then you need to add `@wang1212/eslint-config/react-typescript` in your **.eslintrc.json**:\n\n   ```diff\n   {\n   - \"extends\": [\"@wang1212/eslint-config\"],\n   + \"extends\": [\"@wang1212/eslint-config/react-typescript\"],\n   + \"parser\": \"@typescript-eslint/parser\",\n   + \"parserOptions\": {\n   +   \"project\": './tsconfig.json'\n   + },\n   }\n   ```\n\n### `@wang1212/eslint-config/node`\n\nThis configuration is for [Node.js](https://nodejs.dev/) programs written in JavaScript, based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), [SonarJS](https://github.com/SonarSource/eslint-plugin-sonarjs), [JSDoc](https://jsdoc.app/). (See [Source](./src/node.cjs))\n\nUsing this configuration also requires some extra work.\n\n- You need to add `@wang1212/eslint-config/node` in your **.eslintrc.json**:\n\n  ```diff\n  {\n  - \"extends\": [\"@wang1212/eslint-config\"],\n  + \"extends\": [\"@wang1212/eslint-config/node\"],\n  }\n  ```\n\n## Development Guidelines\n\n### Git Commit Message Format\n\nAdopt [community commit format best practices](https://www.conventionalcommits.org/):\n\n```bash\n# Before\ngit commit\n\n# Now\nnpm run commit\n```\n\n_This constraint relies on tools [commitizen](http://commitizen.github.io/cz-cli/) and [commitlint](https://commitlint.js.org/) provided by the community._\n\n### npm publish\n\nThe version management of this module adopts the specifications recommended by the community [Semantic Versioning](https://semver.org/). Follow version changes and maintain a **CHANGELOG.md**([Learn why](https://keepachangelog.com/)).\n\n```bash\n# Update version and generate changelog before publishing to npm repository\nnpm run release\n# Or, preview\nnpm run release -- --dry-run\n\n# Then publish to npm, if yes is not selected when auto-publishing to npm\nnpm publish # npm publish --access public\n```\n\n_These jobs are done with the help of [release-it](https://github.com/release-it/release-it) tool provided by the community._\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwang1212%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwang1212%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwang1212%2Feslint-config/lists"}