diff --git a/package.json b/package.json index 0da3131..d8e7655 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,8 @@ "@swc/jest": "^0.2.36", "browser-sync": "^3.0.2", "browserslist": "^4.23.3", - "dialog-polyfill": "^0.5.6", "doiuse": "^6.0.2", "eslint": "^9.9.0", - "eslint-plugin-compat": "^6.0.0", "globals": "^15.9.0", "jest": "^29.7.0", "jest-extended": "^4.0.2", diff --git a/run.js b/run.js index 4830c97..5143098 100644 --- a/run.js +++ b/run.js @@ -4,9 +4,6 @@ import swc from '@swc/core' import { transform as transformCss, browserslistToTargets, Features } from 'lightningcss' import browserslist from 'browserslist' import { Readable } from 'stream' -import { ESLint } from 'eslint' -import compat from 'eslint-plugin-compat' -import globals from 'globals' import doiuse from 'doiuse/stream' import zlib from 'zlib' const { readFile, writeFile } = fs.promises @@ -186,43 +183,10 @@ function getCompressedSizes(text) { export async function report() { log('report', 'Running browser compatibility reports...') await Promise.all([ - cssreport(), - jsreport() + cssreport() ]) } -export async function jsreport() { - // TODO: This doesn't work, rip it out - log('js report','Checking JS browser compatibility...') - let js = await scripts(true) - const eslint = new ESLint({ - overrideConfigFile: true, - overrideConfig: { - ...compat.configs['flat/recommended'], - languageOptions: { - ecmaVersion: 2018, - globals: { - ...globals.browser - } - }, - rules: { - 'compat/compat': 'error', - ...compat.configs['flat/recommended'].rules - }, - settings: { - browsers: 'last 10 years' - } - } - }) - - const lint = await eslint.lintText(js[0]) - const formatter = await eslint.loadFormatter('stylish') - const jsReport = formatter.format(lint) - if (jsReport.length === 0) { - log('js report','✅ No JS Compatibilty warnings') - } else log('js report', jsReport) -} - export async function cssreport() { log('css report','Checking CSS browser compatibility...') let css = await styles(true) @@ -299,7 +263,6 @@ async function main() { case 'scripts': scripts(); break case 'build': build(); break case 'report': report(); break - case 'jsreport': jsreport(); break default: break } }