Ideas
🚧 Do you want to request a feature? Please review the list below and open an issue.
Inspiration#
Here are tools that this linter could learn from. Suggestions welcome.
Linting rules#
- https://github.com/yannickcr/eslint-plugin-react, last reviewed 2020-04-16
- https://github.com/vuejs/eslint-plugin-vue, last reviewed 2020-04-16
- https://github.com/htmlhint/HTMLHint, last reviewed 2020-04-16
Accessibility checks#
- https://github.com/evcohen/eslint-plugin-jsx-a11y, last reviewed 2020-04-16
- https://github.com/squizlabs/HTML_CodeSniffer
- https://github.com/dequelabs/axe-core
- https://github.com/GoogleChrome/accessibility-developer-tools
HTML validation#
- Nu "vnu.jar" HTML5 validator https://github.com/validator/validator
- https://github.com/html5lib/html5lib-python
- https://github.com/html5lib/html5lib-tests
Developer tools#
- https://github.com/prettier/prettier, last reviewed 2020-05-06
- https://github.com/eslint/eslint, last reviewed 2020-05-06
- https://github.com/stylelint/stylelint
Research#
Python developer tools#
Most of curlylint’s CLI is already based on that of black: include/excludes, config file, error, success, verbose output. It would be nice to learn from flake8’s plugin system, eventually.
- https://pypi.org/project/flake8/
- https://github.com/tommilligan/flake8-fixme
- https://github.com/PyCQA/flake8-bugbear
- https://github.com/psf/black, last reviewed 2020-05-06
CLI ideas#
- Support configuration from
setup.cfg. - Support configuration from
.editorconfig. - Support using a file with ignore paths.
- Disable colored output.
- Cache results / only check changed files.
Linting ideas#
- Support disabling rules via code comments.
Rules ideas#
Wishlist#
Code smells#
<input type="submit">is banned. Use<button type="submit">instead.<input type="button">is banned. Use<button type="button">instead.<button>elements must have atypeattribute.- Duplicate attributes on the same element are disallowed.
idmust be unique.- Forbid specified attributes on specified elements.
- Forbid speicified elements.
- Disallow common typos (e.g.
tab-indexinstead oftabindex). - Disallow unescaped HTML entities
HTML5#
type="text/javascript"is banned on<script>elements.- Deprecated attributes on an element are disallowed.
- Deprecated elements are disallowed.
- Elements can only have the attributes that are valid for them.
- Void elements have a consistent self-closing tag style.
Accessibility#
<img>tags must have analtattribute.<a>tags must have textual content.<a>tags cannot have content such as "Read more".<a>tags are only used for links.- Alt text doesn’t start or end with "picture", "image", or "icon". Doesn’t end with a file extension.
<table>elements must have a<caption>.- Multiple heading elements cannot have the same content.
- Heading elements must have content.
autocompleteattribute must use valid values.<html>element has alangattribute.- Enforce lang attribute has a valid value.
- Enforce iframe elements have a title attribute.
- Enforce
autofocusattribute is not used. tabindexshould only be declared on interactive elements.- Enforce
tabindexvalue is not greater than zero.
ARIA#
- All ARIA roles must be valid.
- All ARIA attributes must be valid.
- Forbidden ARIA roles: menu, menubar, menuitem.
- Non-interactive elements should not be assigned interactive roles.
- Enforce explicit
roleis not the same as implicit/default role property on element. - Enforce that elements with ARIA roles must have all required attributes for that role.
- Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.
Security#
- Enforce usage of
rel="noopener noreferrer"fortarget="\_blank"<a>tags - Enforce methods always having an explicit
methodto avoid unintentional data leaks in logs. - Forbid the use of
javascript:URLs - Forbid the use of inline script tags without CSP-compatible fingerprints.
- Forbid the use of inline styles without CSP-compatible fingerprints.
- Forbid loading scripts / styles from third-party resources, even with integrity attributes.
- Forbid the use of
http:URLs - Forbid the use of protocol-relative URLs
//
Template languages#
- Forbid specified template language syntax.
Django#
{% if foo %}{{ foo }}{% else %}bar{% endif %}=>{{ foo|default:"bar" }}{% with foo as bar %}... [ not using{{ bar }}] ...{% endwith %}{% endblock %}vs.{% endblock blockname %}- Forbid marking variables as "safe"
Code style#
- Enforce ordering of HTML attributes
- Enforce compliance with
.editorconfig
Rejected ideas#
Formatting#
See https://github.com/prettier/prettier/issues/5944#issuecomment-549805364. I’m much more interested in having automated formatting with a Prettier plugin, than adding formatting rules to a linter.