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

docs: standardize indentation and tag positioning #22157

Merged
merged 5 commits into from Jul 18, 2023

Conversation

shahabbasian
Copy link
Contributor

@shahabbasian shahabbasian commented Jul 15, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I believe that newcomers tend to internalize the code patterns present in the documentation as they read it. This will indeed help them write clean code by following established patterns.

  • The tag has been added to the code snippets in the "Class And Style Bindings" section of the documentation.
  • Standardize indentation and tag positioning across all pages.
  • All <script setup> changed to <script setup lang="ts">
  • πŸ“ Checklist

    • I have linked an issue or discussion.
    • I have updated the documentation accordingly.

…And Style Bindings" section of the documentation.
@stackblitz
Copy link

stackblitz bot commented Jul 15, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nuxt-studio
Copy link

nuxt-studio bot commented Jul 15, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview 7c8d5b5

@shahabbasian shahabbasian changed the title The <template> tag has been added to the code snippets in the "Class And Style Bindings" section of the documentation. docs: The <template> tag has been added to the code snippets in the "Class And Style Bindings" section of the documentation. Jul 15, 2023
@shahabbasian shahabbasian changed the title docs: The <template> tag has been added to the code snippets in the "Class And Style Bindings" section of the documentation. docs: Standardize indentation and tag positioning across all pages. Jul 15, 2023
@florian-lefebvre
Copy link
Contributor

Awesome! Maybe we can also get rid of lang="ts" when not using ts features. Wdyt?

@shahabbasian
Copy link
Contributor Author

shahabbasian commented Jul 16, 2023

Awesome! Maybe we can also get rid of lang="ts" when not using ts features. Wdyt?

I don't know if this is Nuxt team policy or if it's just a habit for the programmer to include lang="ts" for sections that are not using TypeScript.

If Nuxt team approves, I'm also willing to fix this issue.

@florian-lefebvre
Copy link
Contributor

Cc @danielroe

@danielroe
Copy link
Member

I would recommend keeping that in as a sensible default.

@shahabbasian
Copy link
Contributor Author

I would recommend keeping that in as a sensible default.

Are you in favor of converting all <script setup> blocks to <script setup lang="ts"> in the same pull request?

@danielroe
Copy link
Member

Yes πŸ‘

In general when we do things like this it would also be nice to add some kind of test or rule to ensure the default continues to be applied, but that's not necessarily on you to do.

<button v-if="!show" @click="show = true">Show List</button>
</div>
</template>

<script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's convert to composition api?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this. It may be intentional to let the user know they can work with both modes. Because in the example below, the Composition API has been used.

Copy link
Member

@danielroe danielroe Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worth ultimately supporting a toggle between modes but for now we can probably leave them as they are.

Like Vue, our default should be composition API/script setup unless we are specifically explaining the options API.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! ❀️

@danielroe danielroe changed the title docs: Standardize indentation and tag positioning across all pages. docs: standardize indentation and tag positioning Jul 18, 2023
@danielroe danielroe merged commit bea6ed1 into nuxt:main Jul 18, 2023
2 checks passed
This was referenced Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants