eslint-plugin-baseline-guard
v1.0.3
Published
ESLint plugin to warn on non-Baseline features
Downloads
10
Readme
eslint-plugin-baseline-guard
ESLint plugin that warns when code uses web platform features that aren’t part of the Baseline by your chosen year.
Install
- npm i -D eslint eslint-plugin-baseline-guard
Configure
- .eslintrc.js:
- module.exports = {
- plugins: ["baseline-guard"],
- rules: {
- "baseline-guard/no-non-baseline": ["warn", { baseline: 2025 }]
- }
- }
- module.exports = {
Examples
- Warn when using pre-Baseline features:
- document.body.style.has
- :has(
- inert
- Adjust the year to match your target support: { baseline: 2024 }
How it works
- Uses web-features data to map identifiers/members/tags/attrs to features
- Compares Baseline status to your configured year
Related packages
- baseline-guard-core: shared logic and APIs
- baseline-guard-cli: command-line scanner for CI and local
Author
- Raiyan Siddique
Repository
- https://github.com/raiyansiddz/baseline-guard
License
- MIT
