{"id":15198370,"url":"https://github.com/asmyshlyaev177/eslint-plugin-maintainable","last_synced_at":"2026-02-19T06:32:07.604Z","repository":{"id":221344866,"uuid":"753992010","full_name":"asmyshlyaev177/eslint-plugin-maintainable","owner":"asmyshlyaev177","description":"Eslint config to keep code clean and in maintainable state. Prettier included","archived":false,"fork":false,"pushed_at":"2024-07-12T07:32:05.000Z","size":246,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T03:44:11.323Z","etag":null,"topics":["clean-code","coding-standards","coding-style","eslint","eslint-config","eslint-plugin","maintainable","maintainable-code","prettier","quality","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-maintainable","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/asmyshlyaev177.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-07T07:23:08.000Z","updated_at":"2024-07-12T07:32:08.000Z","dependencies_parsed_at":"2024-03-07T10:54:02.648Z","dependency_job_id":"e7825b8e-37e0-42e2-a37f-c63c6a36727e","html_url":"https://github.com/asmyshlyaev177/eslint-plugin-maintainable","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"c5f467bf18af5dbaa78ddc616397d5e2df7e4f18"},"previous_names":["asmyshlyaev177/eslint-plugin-maintainable"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/asmyshlyaev177/eslint-plugin-maintainable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmyshlyaev177%2Feslint-plugin-maintainable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmyshlyaev177%2Feslint-plugin-maintainable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmyshlyaev177%2Feslint-plugin-maintainable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmyshlyaev177%2Feslint-plugin-maintainable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asmyshlyaev177","download_url":"https://codeload.github.com/asmyshlyaev177/eslint-plugin-maintainable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmyshlyaev177%2Feslint-plugin-maintainable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262981096,"owners_count":23394463,"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":["clean-code","coding-standards","coding-style","eslint","eslint-config","eslint-plugin","maintainable","maintainable-code","prettier","quality","typescript"],"created_at":"2024-09-28T01:04:12.517Z","updated_at":"2025-10-17T11:27:05.219Z","avatar_url":"https://github.com/asmyshlyaev177.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-maintainable\n\n[![npm](https://img.shields.io/npm/v/eslint-plugin-maintainable.svg)](https://www.npmjs.com/package/eslint-plugin-maintainable)\n\nThis plugin focused on keeping the code clean, maintainable, and readable for humans. Because coders read existing code most of the times, cumbersome code will slow you down and lead to bugs.\n\nThis is achieved via rules like `complexity`, `sonarjs/cognitive-complexity`, `max-params`, `max-nested-callbacks` etc.\nAlso, line length is limited to 80 characters, so it's convinient to split and edit code side by side.\n\nAlso includes setup to format code with `prettier` via eslint, so no hassle to set up those two.\n\nFeel free to ask questions or propose improvements to \"issues\"\n\n:star: if you like the the project :)\n\n## Installation and setup\n\n### 1. Install via npm\n\nNeed eslint 8+ and prettier 3+\n\n```sh\nnpm i -D eslint@8 eslint-plugin-maintainable@latest prettier@latest\n```\n\n### 2. Extend recommended config and add `maintainable` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix\n\n```json\n\n{\n    \"extends\": [\n      \"plugin:maintainable/recommended\",\n      \"plugin:maintainable/react\",\n      \"...your others configs\"\n    ],\n    \"plugins\": [\n        \"maintainable\"\n        \"...your others plugins\"\n    ]\n}\n```\n\n#### Typescript/JS\n\nBy default plugin intended to be used with Typescript, but can tune it for pure JS, just change parser to default \"espree\" or \"@babel/eslint-parser\".\n\n```json\n \"parser\": \"espree\",\n```\n\n### 3. Add `.editorconfig`, IDEs and prettier will format code according to it\n\n```text\nroot = true\n\n[*]\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nindent_style = space\nindent_size = 2\nquote_type = single\nmax_line_length = 80\n```\n\n### 4. Add browserslist to `package.json`\n\n`eslint-plugin-compat` will tell you if you use api that not supported by browsers\n\n```json\n  \"browserslist\": [\n    \"last 5 Chrome versions\",\n    \"last 5 ChromeAndroid versions\",\n    \"last 5 Firefox versions\",\n    \"last 5 FirefoxAndroid versions\",\n    \"Firefox ESR\",\n    \"last 3 Safari major versions\",\n    \"last 2 iOS major versions\"\n  ],\n```\n\n### 5. Enforce it via `husky` and `lint-staged`\n\nInstall deps\n\n```sh\nnpm i -D husky lint-staged\nnpx husky install\n```\n\nMore details at [lint-staged repo](https://github.com/lint-staged/lint-staged?tab=readme-ov-file#installation-and-setup)\n\nEdit(or create) file `pre-commit` in `.husky` directory with this content:\n```sh\n#!/usr/bin/env sh\n. \"$(dirname -- \"$0\")/_/husky.sh\"\n\nnpx lint-staged\n```\n\nAnd update `package.json`\n\n```json\n  \"lint-staged\": {\n    \"*.{js,jsx,ts,tsx}\": [\n      \"eslint --fix\",\n    ],\n    \"*.{html,css,less,ejs,json}\": [\n      \"prettier --write\",\n    ]\n  },\n\n```\n\n## Configurations\n\n|     | Name          | Description                             |\n| --- | ------------- | --------------------------------------- |\n| ✅  | `base`        | Basic rules and prettier formatter      |\n| ✅  | `recommended` | Basic + more rules for Node and Browser |\n| ✅  | `react`       | Basic + React specific rules                    |\n\nYou can take a look at configs [definitions](https://github.com/asmyshlyaev177/eslint-plugin-maintainable/blob/main/lib/index.cjs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmyshlyaev177%2Feslint-plugin-maintainable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasmyshlyaev177%2Feslint-plugin-maintainable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmyshlyaev177%2Feslint-plugin-maintainable/lists"}