{"id":20691346,"url":"https://github.com/metafizzy/eslint-plugin-metafizzy","last_synced_at":"2025-04-22T17:04:05.283Z","repository":{"id":43412604,"uuid":"254861412","full_name":"metafizzy/eslint-plugin-metafizzy","owner":"metafizzy","description":"ESLint config and rules for Metafizzy","archived":false,"fork":false,"pushed_at":"2023-07-18T21:40:33.000Z","size":149,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T00:34:36.257Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metafizzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-04-11T12:19:21.000Z","updated_at":"2022-03-28T16:11:49.000Z","dependencies_parsed_at":"2024-06-19T01:26:10.000Z","dependency_job_id":"b78c5e95-fb1e-4bc6-b5bb-f049a8f9c4ca","html_url":"https://github.com/metafizzy/eslint-plugin-metafizzy","commit_stats":{"total_commits":38,"total_committers":2,"mean_commits":19.0,"dds":0.02631578947368418,"last_synced_commit":"e876ce69157dc9e196e6a2f0c6a275dbccd80ee6"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Feslint-plugin-metafizzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Feslint-plugin-metafizzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Feslint-plugin-metafizzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Feslint-plugin-metafizzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metafizzy","download_url":"https://codeload.github.com/metafizzy/eslint-plugin-metafizzy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285644,"owners_count":21405296,"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":[],"created_at":"2024-11-16T23:16:21.526Z","updated_at":"2025-04-22T17:04:05.255Z","avatar_url":"https://github.com/metafizzy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-metafizzy\n\n_ESLint config and custom rules for development on [Metafizzy](https://metafizzy.co) projects_\n\nI'm persnickety about my code style. While ESList captures 95% of what I want, there are some rules that I need to customize. See custom rules below.\n\nGenerally, I like spaces in braces and around operators\n\n``` js\ngetItem( element )\n[ x, y ]\n1 + 2\n```\n\nBut I also like no spaces for singular values that are already separated with syntax highlighting\n\n``` js\ngetItem('hydrogen')\nitems[i]\nTAU/4\n```\n\nI concede it's a bit idiosyncratic, but I find it easier to read.\n\n## Usage\n\nInstall with npm.\n\n```\nnpm install eslint-plugin-metafizzy --save-dev\n```\n\nAdd `metafizzy` to `plugins` in your ESLint config.\n\n``` js\n// .eslintrc.js\nmodule.exports = {\n  plugins: [\n    'metafizzy',\n  ],\n};\n```\n\nSet [`extends`](https://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin) to `plugin:metafizzy/configName` to use a plugin configuration. This plugin provies three configurations: `browser`, `node`, and `base`.\n\n``` js\n// .eslintrc.js\nmodule.exports = {\n  plugins: [\n    'metafizzy',\n  ],\n  extends: 'plugin:metafizzy/browser',\n};\n```\n\nSee `src/eslintrc.js` for base configuration and `src/index.js` for\n\n## Custom rules\n\nAll three rules work in place of official [ESLint rules](https://eslint.org/docs/rules/). The official need to be disabled in order for these custom rules to work, which they are if your config extends `plugin:metafizzy/configName`.\n\n### metafizzy/spaces-in-parens\n\nEnforces consistent spacing inside parentheses.\n\nBy default, parentheses have inside spaces.\n\n``` js\ngetItem( element )\ngetItem( a, b )\ngetItem( [ x, y ], [ u, v ] )\ngetItem( 1 + 2 )\ngetItem( 'row' + rowNumber )\n```\n\nParentheses with content that is a single _String_, _Array_, or _Object_ have no spaces.\n\n``` js\ngetItem('hydrogen')\ngetItem([ x, y ])\ngetItem({ bloodType: 'AB Positive' })\n```\n\n### metafizzy/computed-property-spacing\n\nEnforces spacing inside computed property brackets.\n\nBy default, properties have spaces inside brackets.\n\n``` js\nitems[ index ]\nitems[ 10 + 4 ]\nitems[ 'last' + 'Index' ]\n```\n\nProperties that are numbers, single-character variables, or single strings have no spaces inside brackets.\n\n``` js\nitems[1]\nitems[i]\nitems['hydrogen-element']\n```\n\n### metafizzy/space-infix-ops\n\nEnforces consistent spacing around operators.\n\nBe default, operators have spaces around them.\n\n``` js\n1 + 2\nvar a = b\na ? b : c\n```\n\nThe division operator `/`, when both preceeding and following value are either a number or singular variable have no spaces, so they appear more like a fraction.\n\n```\n1/2\nTAU/4\n```\n\n---\n\nMIT License. By [Metafizzy 🌈🐻](https://metafizzy.co)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafizzy%2Feslint-plugin-metafizzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetafizzy%2Feslint-plugin-metafizzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafizzy%2Feslint-plugin-metafizzy/lists"}