chore: bump browserlists version and load tscompat browserlist from file (#19212)

* chore: bump browserlists version to include latest edge browsers

* chore: load tscompat browser list from the .browserslistrc file
This commit is contained in:
Zack Pollard
2025-06-16 16:03:46 +01:00
committed by GitHub
parent 5fc448bc97
commit 176d53c1b3
3 changed files with 20 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ import eslintPluginCompat from 'eslint-plugin-compat';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import parser from 'svelte-eslint-parser';
@@ -23,7 +24,13 @@ export default typescriptEslint.config(
rules: {
'tscompat/tscompat': [
'error',
{ browserslist: ['> 0.2% and last 4 major versions', '> 0.5%', 'not dead', 'edge >= 135', 'not edge < 135'] },
{
browserslist: fs
.readFileSync(path.join(__dirname, '.browserslistrc'), 'utf8')
.split('\n')
.map((line) => line.trim())
.filter((line) => line && !line.startsWith('#')),
},
],
},
languageOptions: {