Skip to content

Commit

Permalink
[docs] Use "cannot" instead of "can't" or "can not" (mui#11986)
Browse files Browse the repository at this point in the history
Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Lukas <[email protected]>
  • Loading branch information
2 people authored and thomasmoon committed Sep 6, 2024
1 parent bf65ef9 commit a87685e
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .github/styles/Blog/ComposedWords.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ swap:
'sub components': subcomponents
'use-case': 'use case'
'usecase': 'use case'
"can't": 'cannot'
'can not': 'cannot'
2 changes: 1 addition & 1 deletion changelogOld/CHANGELOG.v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
- [DataGrid] Close other actions menus when opening a new one (#3492) @m4theushw
- [DataGrid] Deprecate `getValue` param from the cell and row params (#3369) @flaviendelangle
- [DataGrid] Fix value parsing in date input (#3307) @alexfauquette
- [DataGrid] Fix can't enter 0 on numeric column (#3491) @m4theushw
- [DataGrid] Fix cannot enter 0 on numeric column (#3491) @m4theushw
- [DataGrid] Fix scrolling bug when an action is focused (#3483) @alexfauquette
- [DataGrid] Remove `line-height` from `GridCell` (#3446) @DanailH
- [DataGridPro] Block edition for auto-generated rows (#3547) @flaviendelangle
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/column-pinning/column-pinning.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ To disable the pinning of a single column, set the `pinnable` property in `GridC

### Pin non-pinnable columns programmatically

It may be desirable to allow one or more columns to be pinned or unpinned programmatically that can not be pinned or unpinned on the UI (i.e. columns for which prop `disableColumnPinning = true` or `colDef.pinnable = false`).
It may be desirable to allow one or more columns to be pinned or unpinned programmatically that cannot be pinned or unpinned on the UI (i.e. columns for which prop `disableColumnPinning = true` or `colDef.pinnable = false`).
This can be done in one of the following ways.

- (A) Initializing the pinned columns
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/editing/AskConfirmationBeforeSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function AskConfirmationBeforeSave() {
resolve(response);
setPromiseArguments(null);
} catch (error) {
setSnackbar({ children: "Name can't be empty", severity: 'error' });
setSnackbar({ children: 'Name cannot be empty', severity: 'error' });
reject(oldRow);
setPromiseArguments(null);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/editing/AskConfirmationBeforeSave.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function AskConfirmationBeforeSave() {
resolve(response);
setPromiseArguments(null);
} catch (error) {
setSnackbar({ children: "Name can't be empty", severity: 'error' });
setSnackbar({ children: 'Name cannot be empty', severity: 'error' });
reject(oldRow);
setPromiseArguments(null);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/editing/ServerSidePersistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useFakeMutation = () => {
new Promise((resolve, reject) => {
setTimeout(() => {
if (user.name?.trim() === '') {
reject(new Error("Error while saving user: name can't be empty."));
reject(new Error('Error while saving user: name cannot be empty.'));
} else {
resolve({ ...user, name: user.name?.toUpperCase() });
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/editing/ServerSidePersistence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const useFakeMutation = () => {
new Promise<Partial<User>>((resolve, reject) => {
setTimeout(() => {
if (user.name?.trim() === '') {
reject(new Error("Error while saving user: name can't be empty."));
reject(new Error('Error while saving user: name cannot be empty.'));
} else {
resolve({ ...user, name: user.name?.toUpperCase() });
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/filtering/QuickFilteringCustomLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin'];

const getApplyQuickFilterFnSameYear = (value) => {
if (!value || value.length !== 4 || !/\d{4}/.test(value)) {
// If the value is not a 4 digit string, it can not be a year so applying this filter is useless
// If the value is not a 4-digit string, it cannot be a year so applying this filter is useless
return null;
}
return (cellValue) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const getApplyQuickFilterFnSameYear: GetApplyQuickFilterFn<any, unknown> = (
value,
) => {
if (!value || value.length !== 4 || !/\d{4}/.test(value)) {
// If the value is not a 4 digit string, it can not be a year so applying this filter is useless
// If the value is not a 4-digit string, it cannot be a year so applying this filter is useless
return null;
}
return (cellValue) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/filtering/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Filters are enabled by default, but you can easily disable this feature by setti

To disable the filter of a single column, set the `filterable` property in `GridColDef` to `false`.

In the example below, the _rating_ column can not be filtered.
In the example below, the _rating_ column cannot be filtered.

```js
<DataGrid columns={[...columns, { field: 'rating', filterable: false }]} />
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/filtering/quick-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ In the example below, a custom filter is created for the `date` column to check
```ts
const getApplyQuickFilterFn: GetApplyQuickFilterFn<any, unknown> = (value) => {
if (!value || value.length !== 4 || !/\d{4}/.test(value)) {
// If the value is not a 4 digit string, it can not be a year so applying this filter is useless
// If the value is not a 4 digit string, it cannot be a year so applying this filter is useless
return null;
}
return (cellValue) => {
Expand Down
4 changes: 2 additions & 2 deletions docs/data/data-grid/pagination/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You should provide an array of items, each item should be one of these types:
Use the `autoPageSize` prop to auto-scale the `pageSize` to match the container height and the max number of rows that can be displayed without a vertical scroll bar.

:::warning
You can't use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.
You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.
:::

{{"demo": "PageSizeAuto.js", "bg": "inline"}}
Expand All @@ -42,7 +42,7 @@ You can't use both the `autoPageSize` and `autoHeight` props at the same time be

The default pagination behavior depends on your plan.

- On the `DataGrid`, pagination is enabled by default and can't be disabled.
- On the `DataGrid`, pagination is enabled by default and cannot be disabled.
- On the `DataGridPro` and `DataGridPremium`, pagination is disabled by default; use the `pagination` prop to enable it.

The following example activates pagination on a `DataGridPremium` component.
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/row-grouping/row-grouping.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ It will disable all the features related to the row grouping, even if a model is
### For some columns

In case you need to disable grouping on specific column(s), set the `groupable` property on the respective column definition (`GridColDef`) to `false`.
In the example below, the `director` column can not be grouped. And in all example, the `title` and `gross` columns can not be grouped.
In the example below, the `director` column cannot be grouped. In all examples, the `title` and `gross` columns cannot be grouped.

{{"demo": "RowGroupingColDefCanBeGrouped.js", "bg": "inline", "defaultCodeOpen": false}}

Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/validation/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Please note that `shouldDisableDate` will execute on every date rendered in the

For components supporting date range edition (`DateRangePicker`, `DateTimeRangePicker`)—the `shouldDisableDate` prop receives a second argument to differentiate the start and the end date.

In the example below—the start date can't be in the weekend but the end date can.
In the example below—the start date cannot be in the weekend but the end date can.

{{"demo": "DateRangeValidationShouldDisableDate.js", "defaultCodeOpen": false}}

Expand Down
2 changes: 1 addition & 1 deletion docs/data/introduction/support/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can search through existing questions and answers to see if someone has aske
- mui-x-date-picker
- mui-x-charts

If you can't find your answer, [ask a new question](https://stackoverflow.com/questions/ask?tags=reactjs%20mui-x) using the relevant tags.
If you cannot find your answer, [ask a new question](https://stackoverflow.com/questions/ask?tags=reactjs%20mui-x) using the relevant tags.

## Technical support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ The codemod will take care of renaming the prop to keep the existing functionali

In v5, it was possible to import adapters either from either `@date-io` or `@mui/x-date-pickers` which were the same.
In v6, the adapters are extended by `@mui/x-date-pickers` to support [fields components](/x/react-date-pickers/fields/).
Which means adapters can not be imported from `@date-io` anymore. They need to be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`.
Which means adapters cannot be imported from `@date-io` anymore. They need to be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`.
Otherwise, some methods will be missing.
If you do not find the adapter you were using—there probably was a reason for it, but you can raise an issue expressing interest in it.

Expand Down
2 changes: 1 addition & 1 deletion docs/data/tree-view/rich-tree-view/items/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ It could be achieved by either defining the prop outside the component scope or
:::

:::warning
Unlike the `SimpleTreeView` component, the `RichTreeView` component only supports string labels, you can't pass React nodes to it.
Unlike the `SimpleTreeView` component, the `RichTreeView` component only supports string labels, you cannot pass React nodes to it.
:::

## Disabled items
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/reportBrokenLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ write('Broken links found by `yarn docs:link-check` that exist:\n');
Object.keys(usedLinks)
.filter((link) => link.startsWith('/'))
.filter((link) => !availableLinks[removeUnsupportedHash(link)])
// unstyled sections are added by scripts (can not be found in markdown)
// unstyled sections are added by scripts (cannot be found in markdown)
.filter((link) => !link.includes('#unstyled'))
.filter((link) => UNSUPPORTED_PATHS.every((unsupportedPath) => !link.includes(unsupportedPath)))
.sort()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ChartsReferenceLine(props: ChartsReferenceLineProps) {
const { x, y } = props;
if (x !== undefined && y !== undefined) {
throw new Error(
'MUI X Charts: The ChartsReferenceLine can not have both `x` and `y` props set.',
'MUI X Charts: The ChartsReferenceLine cannot have both `x` and `y` props set.',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export const useGridColumnReorder = (
forbiddenIndexes.current[indexWithOffset] ||
allColumns[indexWithOffset].field === nextVisibleColumnField
) {
// If we ended up on a visible column, or a forbidden one, we can not do the reorder
// If we ended up on a visible column, or a forbidden one, we cannot do the reorder
canBeReordered = false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/x-data-grid/src/hooks/features/rows/useGridRows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const useGridRows = (
if (props.signature === GridSignature.DataGrid && updates.length > 1) {
throw new Error(
[
"MUI X: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.",
'MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.',
'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.',
].join('\n'),
);
Expand Down Expand Up @@ -387,7 +387,7 @@ export const useGridRows = (
if (props.signature === GridSignature.DataGrid && newRows.length > 1) {
throw new Error(
[
"MUI X: You can't replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.",
'MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.',
'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.',
].join('\n'),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/src/internals/utils/propValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const propValidatorsDataGrid: PropValidator<DataGridProcessedProps>[] = [
props.autoHeight &&
[
'MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.',
'You can not use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.',
'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.',
'',
'Please remove one of these two props.',
].join('\n')) ||
Expand Down
4 changes: 2 additions & 2 deletions packages/x-data-grid/src/tests/rows.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ describe('<DataGrid /> - Rows', () => {
{ id: 2, brand: 'Pum' },
{ id: 3, brand: 'Jordan' },
]),
).to.throw(/You can't update several rows at once/);
).to.throw(/You cannot update several rows at once/);
});

it('should allow to update one row at the time', () => {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ describe('<DataGrid /> - Rows', () => {
}).toErrorDev(
[
'MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.',
'You can not use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.',
'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.',
'',
'Please remove one of these two props.',
].join('\n'),
Expand Down

0 comments on commit a87685e

Please sign in to comment.