PostCSS Selector Lint is a v1.0.2 PostCSS plugin that warns about disallowed CSS selector types (type, class, id, universal, attribute, pseudo) in global vs local (nested) scope. It helps prevent scope pollution by flagging non-nested type/tag selectors. The configuration is fully customizable per scope. Release cadence is low; latest version is stable. Key differentiator: scope-aware linting (global vs local) rather than simple selector blacklisting. Alternatives like stylelint offer broader linting but require more configuration.
npm install postcss-selector-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up PostCSS Selector Lint with a configuration that restricts global selectors to class only, but allows type, universal, and attribute selectors in local scope.
Use property name 'psuedo' in config object.
Ensure PostCSS version 7 or lower, or verify compatibility. If using PostCSS 8, consider using an alternative like stylelint-scoped-selector.
Use with PostCSS 7, or upgrade to a maintained fork/alternative.
Provide exact filenames like 'reset.css' not '*.css'.
If you encounter issues, consider migrating to a stylelint plugin for selector linting.
Run 'npm install --save-dev postcss-selector-lint' and ensure import path is correct.
Use 'import selectorLint from 'postcss-selector-lint'' (default import) and call as 'postcss([selectorLint(config)])'.
Use default import: 'import selectorLint from 'postcss-selector-lint'.
Change 'pseudo' to 'psuedo' in the configuration object.