We'd like to add a linting rule that heuristically identifies large tables so that we can understand the problem better and find solutions. Since it's not 100% clear how to solve this problem, this should be a hidden linting rule so that editors are not made aware of pages with lint problems that they cannot fix.
Proposal
- A linting rule exists that identifies "large" tables. A large table will be defined given the definition below.
Definition of large table
With Vector 2022's limited width any table with more than 5 columns is likely to be problematic so for the purpose of this lint, for now we're identify large tables using the following JavaScript (we can modify it later as we understand the issue better):
Array.from(document.querySelectorAll('table')).filter((table) => table.querySelectorAll('tr > td, tr > th')[0].parentNode.children.length > 5).length > 0
QA testing
- Visiting https://en.wikipedia.beta.wmflabs.org/wiki/Special:LintErrors should not show a section for "large-tables"
- Visiting https://en.wikipedia.beta.wmflabs.org/wiki/Special:LintErrors/large-tables should list any articles which have large tables. This list should include https://en.wikipedia.beta.wmflabs.org/wiki/A_very_large_table
Sign off steps
- Make sure we have a ticket to analyze https://en.wikipedia.org/wiki/Special:LintErrors/large-tables and do related follow up. - T336316
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T334528#8839063 |
2 | ✅ | T334528#8839063 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T334528#8839110 |
2 | ✅ | T334528#8839110 |