https://github.com/browserslist/lint
Linter for Browserslist config
https://github.com/browserslist/lint
Last synced: 3 months ago
JSON representation
Linter for Browserslist config
- Host: GitHub
- URL: https://github.com/browserslist/lint
- Owner: browserslist
- License: mit
- Created: 2022-06-16T14:59:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-12T05:53:24.000Z (5 months ago)
- Last Synced: 2025-03-29T18:05:56.902Z (4 months ago)
- Language: JavaScript
- Homepage: https://browsersl.ist/
- Size: 193 KB
- Stars: 43
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Browserslist Lint
Check your [Browserslist](https://github.com/browserslist/browserslist/) config
with target browsers for popular mistakes.```sh
npx browserslist-lint
```Or try online: [`browsersl.ist`](https://browsersl.ist/)
Rules:
* `missedNotDead`: lack of `no dead` with queries like `last 2 versions`.
* `countryWasIgnored`: bad coverage in some country with >10M Internet users.
* `limitedBrowsers`: ignoring browsers diversity by calling only
a few browsers directly in config.
* `alreadyDead`: browser with `not` is already in `not dead` or `defaults`.## Pre-Commit Hook
This project is also available as a [pre-commit hook](https://pre-commit.com/). Please add the following to your pre-commit configuration.
```yaml
repos:
- repo: https://github.com/browserslist/lint
id: browserslist-lint
```## JS API
```js
import { lint } from 'browserslist-lint'lint('defaults, not ie 11') // => [{
// id: 'alreadyDead',
// message: '`not ie 11` already in `defaults`'
// fixed: 'defaults'
// }]// Without option with find Browserslist automatically
lint() // => [{ id, message, fixed }]
```