-
-
Prevent bugs by catching unsupported features in real-time. Your essential tool for cross-browser compatibility
-
Our linter catches a family of bugs at once. It ensures your code is robust and compatible by flagging multiple unsupported features.
-
GIF
The 'Before & After' shot. Our linter catches non-Baseline features like toSorted(), ensuring you write robust, bug-free code.
-
Inspiration
I was inspired to build POLYFILL-PAL after facing a common frustration in web development: shipping a modern JavaScript feature only to find out it breaks for users with outdated browsers. Manually checking browser compatibility for every new method is slow and prone to error. I wanted to create a tool that would automate this process and bring browser intelligence directly into the developer's workflow, solving a problem many of us face every day.
What it does
POLYFILL-PAL is a powerful ESLint plugin that helps developers write reliable, cross-browser compatible code. It integrates with the official web-features dataset to automatically detect when a developer uses a JavaScript method or feature that has not yet achieved "Widely available" baseline support. The plugin flags these features in real time, providing a clear error message that warns of potential compatibility issues before the code is even shipped.
How we built it
The project is built on Node.js and ESLint, a widely-adopted standard for code quality. The core logic of the plugin involves parsing a project's code to create an Abstract Syntax Tree (AST). We then traverse this tree, identifying modern JavaScript methods and checking their names against a predefined map. The most critical part of the process is looking up the feature's baseline status in the web-features dataset to determine whether it should be flagged as an error.
Challenges we ran into
The biggest challenge was correctly integrating the web-features data. We faced a series of persistent TypeError errors because the package was exporting its data in an unusual format that was difficult to parse. This required a deep dive into Node.js module resolution and the use of programmatic debugging. We systematically tested different module import formats until we found the one that worked, a process that was both challenging and rewarding.
Accomplishments that we're proud of
We are most proud of building a fully functional and reliable linter from the ground up. Overcoming the complex debugging issues to make the core logic work was a significant accomplishment. We also successfully created a comprehensive test suite using ESLint's RuleTester that validates our rule with both valid and invalid code examples, ensuring the tool is robust and accurate.
What we learned
This project taught me a tremendous amount about the inner workings of ESLint and its new flat configuration system. I learned how to build a custom plugin from scratch and how to write a full suite of unit tests for static code analysis. The debugging process also reinforced the importance of systematic problem-solving and persistence when faced with seemingly impossible errors.
What's next for POLYFILL-PAL
The future for POLYFILL-PAL is bright. I plan to continue developing the project to make it even more valuable for the community. Next steps include:
- Expanding the rule set: Adding support for more web features beyond JavaScript methods.
- Creating an auto-fixer: Automatically suggesting polyfills or fallback code for unsupported features.
- Publishing to npm: Making the plugin easily available for all developers to use.
- Visualizing data: Building a web interface that visually presents the baseline data for a more user-friendly experience.
Built With
- eslint
- github
- javascript
- mocha
- node.js
- npm
- vscode
- web-features
Log in or sign up for Devpost to join the conversation.