{"id":28397619,"url":"https://github.com/myxvisual/stylelint-disable-top-level-selector","last_synced_at":"2025-06-28T08:31:40.681Z","repository":{"id":285773148,"uuid":"959299125","full_name":"myxvisual/stylelint-disable-top-level-selector","owner":"myxvisual","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-03T13:20:17.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T11:07:32.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/myxvisual.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":"2025-04-02T15:08:07.000Z","updated_at":"2025-04-03T13:20:00.000Z","dependencies_parsed_at":"2025-04-03T14:27:28.417Z","dependency_job_id":"5ce40be4-3bb6-49d9-8285-a1bf2768d5cf","html_url":"https://github.com/myxvisual/stylelint-disable-top-level-selector","commit_stats":null,"previous_names":["myxvisual/stylelint-no-top-level-selecto","myxvisual/stylelint-disable-top-level-selector"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/myxvisual/stylelint-disable-top-level-selector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myxvisual%2Fstylelint-disable-top-level-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myxvisual%2Fstylelint-disable-top-level-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myxvisual%2Fstylelint-disable-top-level-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myxvisual%2Fstylelint-disable-top-level-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myxvisual","download_url":"https://codeload.github.com/myxvisual/stylelint-disable-top-level-selector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myxvisual%2Fstylelint-disable-top-level-selector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262400505,"owners_count":23305301,"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":"2025-06-01T01:37:28.175Z","updated_at":"2025-06-28T08:31:40.675Z","avatar_url":"https://github.com/myxvisual.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stylelint-disable-top-level-selector ✂️\n\nA Stylelint plugin that prevents the use of restricted selectors at the top level of your CSS.\n\n[![npm version](https://badge.fury.io/js/stylelint-disable-top-level-selector.svg)](https://www.npmjs.com/package/stylelint-disable-top-level-selector)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## 🚀 Installation\n\n```bash\nnpm install stylelint-disable-top-level-selector --save-dev\n```\n\n## 🛠 Configuration\n\nAdd to your Stylelint config:\n\n```js\nmodule.exports = {\n  plugins: ['stylelint-disable-top-level-selector'],\n  rules: {\n    'plugin/disable-top-level-selector': [true, {\n      restrictedSelectors: ['body', 'html', /^[a-z]+$/],\n      ignoreSelectors: [':root', /^--/],\n      customMessage: selector =\u003e `\"${selector}\" should be nested`\n    }]\n  }\n}\n```\n\n## 🔧 Options\n\n- `restrictedSelectors`: (string|RegExp)[]  \n  Selectors that trigger errors when at top level\n- `ignoreSelectors`: (string|RegExp)[]  \n  Selectors to exclude from checking\n- `customMessage`: string|function  \n  Custom error message (default shows selector)\n\n## ✅ Valid CSS\n\n```css\n.container {\n  \u0026 \u003e div { /* OK: Nested element */ }\n}\n\n:root { /* OK: In ignore list */ }\n```\n\n## ❌ Invalid CSS\n\n```css\nbody { /* Error: Top-level element */ }\ndiv { /* Error: Matches /^[a-z]+$/ */ }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyxvisual%2Fstylelint-disable-top-level-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyxvisual%2Fstylelint-disable-top-level-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyxvisual%2Fstylelint-disable-top-level-selector/lists"}