Could you give me a recommendation for a Node dev module that would audit usage of…
- User
Could you give me a recommendation for a Node dev module that would audit usage of deprecated browser APIs?
Assistant
Yes, here are several Node dev module recommendations that can help audit the usage of deprecated browser APIs in your project. The choice among them might depend on your project's specific setup (e.g., Webpack, Rollup, Vanilla JS, React, Angular, Vue), the type of audit you're looking to perform, and whether you're looking for a more comprehensive code analysis tool or something lightweight focused specifically on deprecated APIs.
Recommendations:
-
ESLint with
compatordeprecationrules:- Why: ESLint is a widely adopted tool for identifying problematic patterns in code. While not exclusively focused on browser API deprecations, its
compatrule can warn about deprecated browser APIs when properly configured with a target environment (e.g., browser lists in.browserlistrc). - How: Install ESLint, configure it with the
compatrule, and specify your target browsers.Configurebashnpm install eslint eslint-plugin-compat --save-dev.eslintrc.json:json{ "plugins": ["compat"], "rules": { "compat/compat": "error" }, "settings": { "compat/compatibleBrowsers": [">1%", "not dead"] } }
- Why: ESLint is a widely adopted tool for identifying problematic patterns in code. While not exclusively focused on browser API deprecations, its
-
browserlist with
browserslist-deprecationsor similar tools:- Why: browserlist is primarily used for targeting specific browser versions, but when combined with tools like
browserslist-deprecations, it can alert you to deprecated APIs for your target browsers. - How: Use
browserslist-deprecationsin your build process to scan for deprecations based on your.browserlistrcfile.Add tobashnpm install browserslist-deprecations --save-devpackage.json:json"scripts": { "check-deprecations": "browserslist-deprecations" }
- Why: browserlist is primarily used for targeting specific browser versions, but when combined with tools like
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.