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-infra] Share vale-config #41176

Merged
merged 10 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .github/styles/Vocab/accept.txt
Empty file.
Empty file removed .github/styles/Vocab/reject.txt
Empty file.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ package-lock.json
size-snapshot.json
docs/public/static/blog/feed/*
# vale downloaded config
.github/styles/Google
.github/styles/write-good
.github/styles/
.nx/cache
12 changes: 3 additions & 9 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
StylesPath = .github/styles
MinAlertLevel = suggestion

Packages = Google
# The docs/writing-rules.zip is generated by `pnpm docs:zipRules`
Packages = Google, docs/writing-rules.zip
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to embed the Google package in docs/writing-rules.zip?

Copy link
Member Author

Choose a reason for hiding this comment

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

Did not tried. Maybe

What would be the usage of adding Google here? Simplifying the .vale.ini to just importing this zip?

Copy link
Member

@Janpot Janpot Feb 20, 2024

Choose a reason for hiding this comment

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

Simplifying the .vale.ini to just importing this zip?

Yes, making the setup on dependent repos as small as possible. I mean, I'm assuming that the Google guide is what we start from for our own writing style.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we started with the basics Google rules we wanted to pick.

I prefer to keep them distinct, such that in material-ui repo we store the rules, and then each sub repo are able to configure its vale as they want by allowing or not different rules

Copy link
Member

Choose a reason for hiding this comment

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

I prefer to keep them distinct, such that in material-ui repo we store the rules, and then each sub repo are able to configure its vale as they want by allowing or not different rules

Is it possible for material-ui repo to provide the Google defaults and X/Toolpad override where necessary? That would allow @samuelsycamore to maintain the these defaults in a single location as well.

Copy link
Member

Choose a reason for hiding this comment

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

In the interest of consistency, I think it would be preferable not to have overrides at the product level—any style rules we use should be applied globally. I can't think of a reason why one product would add or remove rules that shouldn't also apply to all of the other products.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I created #41225 to don't forget. I will take care of it after cleaning all the PR already open :)


[*.md]
# Ignore code injection which start with {{...
BlockIgnores = {{.*

# Custom syle
# BasedOnStyles = Blog

Blog.ComposedWords = YES
Blog.NamingConventions = YES
Blog.Typos = YES
Blog.BrandName = YES
Blog.NoCompanyName = YES
BasedOnStyles = writing-rules

# Google:
Google.FirstPerson = YES # Avoid first-person pronouns such as I, me, ...'.
Expand Down
Binary file added docs/writing-rules.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ swap:
MUI Core: MUI Core
MUI Toolpad: MUI Toolpad
MUI Connect: MUI Connect
# Don't forget to run the following command to generate the package writing-rules.zip file
# Vale uses that ZIP file and not the YAML files.
#
# pnpm docs:zipRules
16 changes: 16 additions & 0 deletions docs/writing-rules/ComponentNameConventions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends: substitution
message: To be consistent with component name, consider using '%s' instead of '%s'.
level: error
ignorecase: true
# swap maps tokens in form of bad: good
# for more information: https://vale.sh/docs/topics/styles/#substitution
swap:
'Heat map': Heatmap
'Tree map': Treemap
'Sparkline Chart': Sparkline
'Gauge Chart': Gauge
'Treemap Chart': Treemap
# Don't forget to run the following command to generate the package writing-rules.zip file
# Vale uses that ZIP file and not the YAML files.
#
# pnpm docs:zipRules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ swap:
'sub components': subcomponents
'use-case': 'use case'
'usecase': 'use case'
'client side': 'client-side'
'server side': 'server-side'
# Don't forget to run the following command to generate the package writing-rules.zip file
# Vale uses that ZIP file and not the YAML files.
#
# pnpm docs:zipRules
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ swap:
Css: CSS
NPM: npm # https://css-tricks.com/start-sentence-npm/
Github: GitHub
# Don't forget to run the following command to generate the package writing-rules.zip file
# Vale uses that ZIP file and not the YAML files.
#
# pnpm docs:zipRules
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ exceptions:
- 'MUI Toolpad'
- 'MUI Connect'
- 'MUI organization' # valid use of a regular space

# Don't forget to run the following command to generate the package writing-rules.zip file
# Vale uses that ZIP file and not the YAML files.
#
# pnpm docs:zipRules
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ swap:
eg: e.g.
eg.: e.g.
'e.g ': 'e.g. '
# Don't forget to run the following command to generate the package writing-rules.zip file
# Vale uses that ZIP file and not the YAML files.
#
# pnpm docs:zipRules
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"docs:typescript:check": "pnpm --filter docs typescript",
"docs:typescript:formatted": "tsx ./docs/scripts/formattedTSDemos",
"docs:mdicons:synonyms": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js,.mjs\" ./docs/scripts/updateIconSynonyms && pnpm prettier",
"docs:zipRules": "cd docs && rm writing-rules.zip && zip -r writing-rules.zip writing-rules",
"extract-error-codes": "cross-env MUI_EXTRACT_ERROR_CODES=true lerna run --concurrency 8 build:modern",
"rsc:build": "tsx ./packages/rsc-builder/buildRsc.ts",
"template:screenshot": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/generateTemplateScreenshots",
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/Select/Select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export type SelectProps<
(Variant extends 'filled'
? FilledSelectProps
: Variant extends 'standard'
? StandardSelectProps
: OutlinedSelectProps);
? StandardSelectProps
: OutlinedSelectProps);

/**
*
Expand Down
Loading