Follow-up from "Combine frontend style guides - docs"
The following discussions from !20969 (merged) should be addressed:
-
@marcia started a discussion: (+2 comments) @tristan.read Danger failed bc of the commit msg... So annoying...
🙄 Could you pls take a look? -
@marcia started a discussion: - [HTML](style/html.md): guidelines for writing HTML code consistent with the rest of the codebase. -
@marcia started a discussion: - [Vue](style/vue.md): Guidelines and conventions for Vue code may be found here. -
@marcia started a discussion: This syntax is not correct, broken link.
-
@marcia started a discussion: Inline links, please.
-
@marcia started a discussion: [`// scss-lint:disable RuleName`](https://github.com/sds/scss-lint#disabling-linters-via-source): -
@marcia started a discussion: TIP: **Tip:** -
@marcia started a discussion: You can run eslint locally by running `yarn eslint`. -
@marcia started a discussion: Use relative paths if the module you are importing is less than two levels up: -
@marcia started a discussion: Avoid adding to the global namespace: -
@marcia started a discussion: Strive to write many small pure functions and minimize where mutations occur: -
@marcia started a discussion: - `{variant}` is either `primary`, `secondary`, `success`, `warning`, `error`. -
@marcia started a discussion: - `{shade}` is one of the shades listed in [colors](https://design.gitlab.com/product-foundations/colors/). -
@marcia started a discussion: - `{size}` is a number from 1-6 from our [Type scale](https://design.gitlab.com/product-foundations/typography/). -
@marcia started a discussion: lower case letters to differentiate between letters and numbers, e.g., `#E3E3E3` -
@marcia started a discussion: 1. Always use double quotes `"` inside templates and single quotes `'` for all other JS: -
@marcia started a discussion: 1. Props should be declared as an object: -
@marcia started a discussion: 1. Required key should always be provided when declaring a prop: -
@marcia started a discussion: Note that there are some scenarios where we need to check for the existence of the property. -
@marcia started a discussion: On those, a default key should not be provided: -
@marcia started a discussion: 1. `data` method should always be a function: -
@marcia started a discussion: 1. Shorthand `@` is preferable over `v-on`: -
@marcia started a discussion: 1. Shorthand `:` is preferable over `v-bind`: -
@marcia started a discussion: 1. Shorthand `#` is preferable over `v-slot`: -
@marcia started a discussion: 1. Prefer self-closing component tags: -
@marcia started a discussion: 1. Prefer a component's kebab-cased name over other styles when using it in a template: -
@marcia started a discussion: 1. Tag order in `.vue` file: -
@marcia started a discussion: 1. When the elements being iterated don't have a unique id, you can use the array index as the `:key` attribute: -
@marcia started a discussion: 1. Tooltips: Do not rely on `has-tooltip` class name for Vue components: -
@marcia started a discussion: 1. Tooltips: When using a tooltip, include the tooltip directive, `./app/assets/javascripts/vue_shared/directives/tooltip.js`. -
@marcia started a discussion: 1. Don't change `data-original-title`: -
@marcia started a discussion: The following yarn scripts are available to do global formatting. -
@marcia started a discussion: To select Prettier as a formatter, add the following properties to your User or Workspace Settings. -
@marcia started a discussion: To automatically format your files with Prettier, add the following properties to your User or Workspace Settings. -
@marcia started a discussion: We need to get rid of all these links in headings, they're completely off of the guidelines.
😬