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

Update the Code Guide documentation and lint everything #2110

Open
zcorpan opened this issue Nov 3, 2021 · 4 comments
Open

Update the Code Guide documentation and lint everything #2110

zcorpan opened this issue Nov 3, 2021 · 4 comments
Labels
Code Quality Non-functional code changes to satisfy APG code style guidelines and linters Infrastructure Related to maintaining task force and repo operations, processes, systems, documentation

Comments

@zcorpan
Copy link
Member

zcorpan commented Nov 3, 2021

The Code Guide wiki page has various recommendations for HTML, CSS, and JavaScript source code style.

We also have various linters, runnable with npm run lint.

We should make sure that the Code Guide reflects the code style that we want, and remove everything that is not important or not easily lintable, and then make sure that the linters check for everything that the code guide requires (where possible). We can implement new lint rules in upstream projects (like in #2069).

If we require things that are not lintable, clarify which rules require manual review.

In the last TF meeting we briefly discussed changing the CSS prefixed properties formatting rule: either remove the rule, or change to disallow prefixed properties.

Other possible changes:

  • HTML
  • CSS
  • JS
    • Is the reference to AirBnB JavaScript Style Guide what we should use? Are the linters following it?
@zcorpan zcorpan added documentation Infrastructure Related to maintaining task force and repo operations, processes, systems, documentation Code Quality Non-functional code changes to satisfy APG code style guidelines and linters labels Nov 3, 2021
@nschonni
Copy link
Contributor

nschonni commented Nov 4, 2021

* [shorthand notation](https://github.com/w3c/aria-practices/wiki/Code-Guide#shorthand-notation): I don't understand the benefit of this rule, and it seems impossible to lint for. Suggest removing.

https://stylelint.io/user-guide/rules/list/shorthand-property-no-redundant-values/

@zcorpan
Copy link
Member Author

zcorpan commented Nov 4, 2021

@nschonni thanks, but that doesn't match what the code guide says. The code guide says to avoid using shorthand properties (sometimes?), not to use the minimal syntax when using shorthand properties.

@zcorpan
Copy link
Member Author

zcorpan commented Nov 10, 2021

In #2077 the rule to disallow prefixes was adopted.

In #2125 @jongund found the prefix for -webkit-user-select isn't needed anymore.

If we can get away with no prefixes, that would be nice IMO. Standardized properties should be supported without prefix, so we can blame browsers when that's not the case.

@ccanash
Copy link

ccanash commented Jan 30, 2024

Hi @mcking65 can you please confirm what the final requirements for this task would be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Quality Non-functional code changes to satisfy APG code style guidelines and linters Infrastructure Related to maintaining task force and repo operations, processes, systems, documentation
Development

No branches or pull requests

4 participants