{"repo":"amilajack/eslint-plugin-compat","free":true,"listed":false,"github":"https://github.com/amilajack/eslint-plugin-compat","clone":"git clone https://github.com/amilajack/eslint-plugin-compat.git","description":"Check the browser compatibility of your code","language":"TypeScript","stars":3183,"topics":["eslint","plugin","api","caniuse","compat","polyfill","browserslist"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"eslint-plugin-compat Lint the browser compatibility of your code Setup 1. Install 2. Update ESLint Config 3. Configure Target Browsers Browser targets are configured using browserslist. You can configure browser targets in your package.json : package.json If no configuration is found, browserslist defaults to \" 0.5%, last 2 versions, Firefox ESR, not dead\" . See browserslist/browserslist for more details. Adding Polyfills Add polyfills to the settings section of your eslint config. Append the name of the object and the property if one exists. Here are some examples: Linting ES APIs (Experimental) This plugin also supports linting the compatibility of ES APIs in addition to Web APIs. This is an experimental feature and is disabled by default. To enable this feature, add the following to your eslint config: Conditional Checks By default, feature detection like if (fetch) { ... } does not trigger a report. To lint these conditionals anyway, set the following: Configuring for Different Environments Browserslist allows specifying different browser queries for multiple environments. By default, this plugin targets the production browserslist environment. To change this default, set the settings.browserslistOpts.env property in your eslint config: Example : A browserslist with multiple environments: Target modern browserslist environment: Demo For a minimal demo, see amilajack/eslint-plugin-compat-demo Inspiration Toolchains for native platforms, like iOS and Android, have had API l","default_branch":null,"files":null,"tree":[],"storefront":"/r/amilajack","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/amilajack/eslint-plugin-compat/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}