Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OWD project proposal: implement BCD's next-generation linter #79

Closed
ddbeck opened this issue Jan 11, 2022 · 3 comments
Closed

OWD project proposal: implement BCD's next-generation linter #79

ddbeck opened this issue Jan 11, 2022 · 3 comments

Comments

@ddbeck
Copy link
Contributor

ddbeck commented Jan 11, 2022

Summary

The current BCD linter is very limited; it doesn't (and cannot) check several things which impede data quality improvements. Starting a new linter, based on what we've learned from projects such as Stumptown and standalone BCD tests, can bring many benefits to consumers in the form of data quality improvements, such as:

  • Consistency up and down the tree (rather than only per source file)
  • Consistency across the tree (e.g., checking consistency between HTML attributes and DOM reflected attributes)

With the existing tools, these quality improvements are high risk to achieve.

Moreover, this would have substantial benefits for authors and contributors, reducing friction in contributing new data or making improvements.

Background

BCD's linter is long in the tooth. It grew from a time when we had lower expectations about what compat data would look like and how we'd work with it. With increasing automation and quality, it's no longer meeting our needs.

Unfortunately, its existing design makes it very difficult to change and improve. It has a number of problems, such as tight coupling, redundant code, and extremely limited test coverage. Even simple bugs require substantial excavation to fix; see mdn/browser-compat-data#12673 as an example.

I've written a high-level design doc for a new linter for BCD, which could make use of developments that emerged after BCD's original linter's design cemented, such as our suite of utility functions, Mocha tests, and more.

Prioritization criteria

  • Effort
    • This is somewhat flexible. A greater time investment will yield more checks and features; a small MVP that implements one consistency check could be completed in a small number of days.
  • Dependencies
    • Needs somebody with familiarity with BCD, Node.js development. Likely Florian or Vinyl.
    • Needs code review. Likely me or Florian, again.
  • Community enablement
    • Helps contributors add better data to BCD
    • Not very easy to involve the community in the initial development, however
  • Momentum
    • This is a new effort, though BCD has substantial reliance factors
  • Enabling learners
    • Not really applicable. Learners are generally unconcerned with compat issues; they need to support their browser, not all browsers.
  • Enabling professionals
    • Significant. Developers need reliable information on which browsers support various APIs, CSS properties, etc.
  • Underrepresented topics / ethical web
    • Not applicable.
  • Operational necessities
    • Not applicable.
  • Addressing needs of the Web industry
    • BCD data is widely used on MDN, caniuse, VS Code, and elsewhere. Far reaching in this area.
@bershanskiy
Copy link

This sounds great!

I have a suggestion: I would be glad if the new linter used async I/O. Occasionally, I have to work on limited computers (HDD-based/old/low-power/etc.) and linting becomes a real drag. For reference, (due to circumstances outside of my control) this week I'm working on a computer with Intel Core 2 Duo (launched in 2006, discontinued in 2012). time npm run test says that real time is 15 seconds, and sum of user and system times is less than 0.25 seconds.

@bershanskiy
Copy link

Since mdn/browser-compat-data#16437 had landed, can we close this issue or is there more work to be done?

@queengooborg
Copy link
Member

This can now be closed as completed! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants