{"id":19280526,"url":"https://github.com/andrienko/eslint-plugin-styled","last_synced_at":"2026-04-16T19:37:30.148Z","repository":{"id":57676833,"uuid":"489159703","full_name":"andrienko/eslint-plugin-styled","owner":"andrienko","description":"A simple plugin to check if you did not forget to import babel macro when using css prop of styled-components - or to remove such import when css prop is not used.","archived":false,"fork":false,"pushed_at":"2022-05-06T08:25:50.000Z","size":8,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T22:08:05.073Z","etag":null,"topics":["babel-macros","eslint-plugin","styled-components"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-styled","language":"TypeScript","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/andrienko.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}},"created_at":"2022-05-05T23:55:17.000Z","updated_at":"2024-04-11T08:36:10.000Z","dependencies_parsed_at":"2022-08-28T06:00:39.194Z","dependency_job_id":null,"html_url":"https://github.com/andrienko/eslint-plugin-styled","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrienko/eslint-plugin-styled","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrienko%2Feslint-plugin-styled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrienko%2Feslint-plugin-styled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrienko%2Feslint-plugin-styled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrienko%2Feslint-plugin-styled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrienko","download_url":"https://codeload.github.com/andrienko/eslint-plugin-styled/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrienko%2Feslint-plugin-styled/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268479902,"owners_count":24256887,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["babel-macros","eslint-plugin","styled-components"],"created_at":"2024-11-09T21:18:53.102Z","updated_at":"2025-10-18T16:40:43.994Z","avatar_url":"https://github.com/andrienko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-styled\n\nA simple plugin to check if you did not forget to import babel macro when using\n`css` prop of `styled-components` - or to remove such import when `css` prop is\nnot used.\n\n## Installation\n\n```shell\nnpm install -D eslint-plugin-styled\n```\n\n## Config\n\nAdd to your `.eslintrc`\n\n```json\n{\n  \"plugins\": [\"styled\"],\n  \"rules\": {\n    \"styled/require-macro\": [2],\n    \"styled/unused-macro\": [2]\n  }\n}\n```\n\n## Options\n\nThere are additional options available.\n\n`prop` defines name of the prop (checks are case-insensitive).\nFor `styled-components` it is `css`.\n\n`import` defines import path. Maybe you would want to use it with some other lib\nor something. It is `styled-components/macro` by default.\n\n```json\n\"rules\": {\n  \"styled/require-macro\": [2,\n    {\n      \"prop\": \"css\",\n      \"import\": \"styled-components/macro\"\n    }\n  ],\n  \"styled/unused-macro\": [2,\n    {\n      \"prop\": \"css\",\n      \"import\": \"styled-components/macro\"\n    }\n  ]\n}\n```\n\n## Disclaimer\n\nThere is no tests here, nor proper meta... Maybe I will add it later. Feel free\nto pull-request these.\n\nThis plugin seeks for import from required file - first import will be used. It\nwon't check for named imports or whatever - there is an assumption that macro\nfile is used only for macro `import \"styled-components/macro`.\n\nI use this to use [styled-components](https://styled-components.com/) with\n[vite](https://vitejs.dev/) and\n[vite-plugin-babel-macros](https://www.npmjs.com/package/vite-plugin-babel-macros)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrienko%2Feslint-plugin-styled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrienko%2Feslint-plugin-styled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrienko%2Feslint-plugin-styled/lists"}