Skip to content

Commit 27471b4

Browse files
authored
Bump prettier to 2.0.0 (#20211)
1 parent 8b32809 commit 27471b4

File tree

855 files changed

+2367
-2540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

855 files changed

+2367
-2540
lines changed

.dependabot/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ update_configs:
3030
- match:
3131
# These should be grouped once a PR for `jss` is opened
3232
dependency_name: 'jss-*'
33-
- match:
34-
# 1.18 started adding trailing commas only compatible with typescript ^3.4
35-
dependency_name: 'prettier'
3633
- match:
3734
# 2.0 started using ES modules instead of CommonJS modules
3835
dependency_name: 'raw-loader'

dangerfile.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function cleanup() {
4343
* @param {number} gzipThreshold
4444
*/
4545
function createComparisonFilter(parsedThreshold, gzipThreshold) {
46-
return comparisonEntry => {
46+
return (comparisonEntry) => {
4747
const [, snapshot] = comparisonEntry;
4848
return (
4949
Math.abs(snapshot.parsed.absoluteDiff) >= parsedThreshold ||
@@ -97,8 +97,8 @@ function formatDiff(absoluteChange, relativeChange) {
9797
* @returns {string}
9898
*/
9999
function generateMDTable(headers, body) {
100-
const headerRow = headers.map(header => header.label);
101-
const alignmentRow = headers.map(header => {
100+
const headerRow = headers.map((header) => header.label);
101+
const alignmentRow = headers.map((header) => {
102102
if (header.align === 'right') {
103103
return ' ---:';
104104
}
@@ -108,7 +108,7 @@ function generateMDTable(headers, body) {
108108
return ' --- ';
109109
});
110110

111-
return [headerRow, alignmentRow, ...body].map(row => row.join(' | ')).join('\n');
111+
return [headerRow, alignmentRow, ...body].map((row) => row.join(' | ')).join('\n');
112112
}
113113

114114
function generateEmphasizedChange([bundle, { parsed, gzip }]) {
@@ -174,7 +174,7 @@ function sieveResults(results) {
174174
const main = [];
175175
const pages = [];
176176

177-
results.forEach(entry => {
177+
results.forEach((entry) => {
178178
const [bundleId] = entry;
179179

180180
if (bundleId.startsWith('docs:')) {
@@ -221,7 +221,7 @@ async function run() {
221221
}
222222

223223
const mainDetailsTable = createComparisonTable(mainResults, {
224-
computeBundleLabel: bundleId => {
224+
computeBundleLabel: (bundleId) => {
225225
if (bundleId === 'packages/material-ui/build/umd/material-ui.production.min.js') {
226226
return '@material-ui/core[umd]';
227227
}
@@ -238,7 +238,7 @@ async function run() {
238238
},
239239
});
240240
const pageDetailsTable = createComparisonTable(pageResults, {
241-
computeBundleLabel: bundleId => {
241+
computeBundleLabel: (bundleId) => {
242242
// a page
243243
if (bundleId.startsWith('docs:/')) {
244244
const host = `https://deploy-preview-${danger.github.pr.number}--material-ui.netlify.com`;

docs/next.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ module.exports = {
142142
function traverse(pages2, userLanguage) {
143143
const prefix = userLanguage === 'en' ? '' : `/${userLanguage}`;
144144

145-
pages2.forEach(page => {
145+
pages2.forEach((page) => {
146146
if (!page.children) {
147147
map[`${prefix}${page.pathname.replace(/^\/api-docs\/(.*)/, '/api/$1')}`] = {
148148
page: page.pathname,
@@ -165,7 +165,7 @@ module.exports = {
165165
} else {
166166
// eslint-disable-next-line no-console
167167
console.log('Considering various locales for SSR');
168-
LANGUAGES_SSR.forEach(userLanguage => {
168+
LANGUAGES_SSR.forEach((userLanguage) => {
169169
traverse(pages, userLanguage);
170170
});
171171
}

docs/pages/_app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function loadCrowdin() {
4949
function LanguageNegotiation() {
5050
const dispatch = useDispatch();
5151
const router = useRouter();
52-
const userLanguage = useSelector(state => state.options.userLanguage);
52+
const userLanguage = useSelector((state) => state.options.userLanguage);
5353

5454
React.useEffect(() => {
5555
if (userLanguage === 'aa') {
@@ -127,9 +127,9 @@ function usePersistCodeVariant(initialCodeVariant = CODE_VARIANTS.JS, codeVarian
127127

128128
function PersistState() {
129129
const dispatch = useDispatch();
130-
const options = useSelector(state => state.options);
130+
const options = useSelector((state) => state.options);
131131

132-
const codeVariant = usePersistCodeVariant(options.codeVariant, nextCodeVariant =>
132+
const codeVariant = usePersistCodeVariant(options.codeVariant, (nextCodeVariant) =>
133133
dispatch({ type: ACTION_TYPES.OPTIONS_CHANGE, payload: { codeVariant: nextCodeVariant } }),
134134
);
135135

@@ -164,7 +164,7 @@ function forcePageReload(registration) {
164164
}
165165

166166
function listenInstalledStateChange() {
167-
registration.installing.addEventListener('statechange', event => {
167+
registration.installing.addEventListener('statechange', (event) => {
168168
// console.log('statechange', event.target.state);
169169
if (event.target.state === 'installed' && registration.waiting) {
170170
// A new service worker is available, inform the user
@@ -244,7 +244,7 @@ Tip: you can access the documentation \`theme\` object directly in the console.
244244
}
245245

246246
function findActivePage(currentPages, pathname) {
247-
const activePage = find(currentPages, page => {
247+
const activePage = find(currentPages, (page) => {
248248
if (page.children) {
249249
if (pathname.indexOf(`${page.pathname}/`) === 0) {
250250
// Check if one of the children matches (for /components)
@@ -305,7 +305,7 @@ function AppWrapper(props) {
305305
return (
306306
<ReactMode>
307307
<NextHead>
308-
{fonts.map(font => (
308+
{fonts.map((font) => (
309309
<link rel="stylesheet" href={font} key={font} />
310310
))}
311311
</NextHead>

docs/pages/_document.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class MyDocument extends Document {
5757
href={`https://material-ui.com${rewriteUrlForNextExport(canonical)}`}
5858
hrefLang="x-default"
5959
/>
60-
{LANGUAGES_SSR.map(userLanguage2 => (
60+
{LANGUAGES_SSR.map((userLanguage2) => (
6161
<link
6262
key={userLanguage2}
6363
rel="alternate"
@@ -97,7 +97,7 @@ export default class MyDocument extends Document {
9797
}
9898
}
9999

100-
MyDocument.getInitialProps = async ctx => {
100+
MyDocument.getInitialProps = async (ctx) => {
101101
// Resolution order
102102
//
103103
// On the server:
@@ -121,7 +121,7 @@ MyDocument.getInitialProps = async ctx => {
121121

122122
ctx.renderPage = () =>
123123
originalRenderPage({
124-
enhanceApp: App => props => sheets.collect(<App {...props} />),
124+
enhanceApp: (App) => (props) => sheets.collect(<App {...props} />),
125125
});
126126

127127
const initialProps = await Document.getInitialProps(ctx);

docs/pages/api-docs/autocomplete.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
4646
| <span class="prop-name">forcePopupIcon</span> | <span class="prop-type">'auto'<br>&#124;&nbsp;bool</span> | <span class="prop-default">'auto'</span> | Force the visibility display of the popup icon. |
4747
| <span class="prop-name">freeSolo</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options. |
4848
| <span class="prop-name">getOptionDisabled</span> | <span class="prop-type">func</span> | | Used to determine the disabled state for a given option. |
49-
| <span class="prop-name">getOptionLabel</span> | <span class="prop-type">func</span> | <span class="prop-default">x => x</span> | Used to determine the string value for a given option. It's used to fill the input (and the list box options if `renderOption` is not provided). |
49+
| <span class="prop-name">getOptionLabel</span> | <span class="prop-type">func</span> | <span class="prop-default">(x) => x</span> | Used to determine the string value for a given option. It's used to fill the input (and the list box options if `renderOption` is not provided). |
5050
| <span class="prop-name">getOptionSelected</span> | <span class="prop-type">func</span> | | Used to determine if an option is selected. Uses strict equality by default. |
5151
| <span class="prop-name">groupBy</span> | <span class="prop-type">func</span> | | If provided, the options will be grouped under the returned string. The groupBy value is also used as the text for group headings when `renderGroup` is not provided.<br><br>**Signature:**<br>`function(options: T) => string`<br>*options:* The option to group. |
5252
| <span class="prop-name">id</span> | <span class="prop-type">string</span> | | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. |

docs/pages/api-docs/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
3535
| <span class="prop-name">hidePrevButton</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, hide the previous-page button. |
3636
| <span class="prop-name">onChange</span> | <span class="prop-type">func</span> | | Callback fired when the page is changed.<br><br>**Signature:**<br>`function(event: object, page: number) => void`<br>*event:* The event source of the callback.<br>*page:* The page selected. |
3737
| <span class="prop-name">page</span> | <span class="prop-type">number</span> | | The current page. |
38-
| <span class="prop-name">renderItem</span> | <span class="prop-type">func</span> | <span class="prop-default">item => &lt;PaginationItem {...item} /></span> | Render the item.<br><br>**Signature:**<br>`function(params: object) => ReactNode`<br>*params:* The props to spread on a PaginationItem. |
38+
| <span class="prop-name">renderItem</span> | <span class="prop-type">func</span> | <span class="prop-default">(item) => &lt;PaginationItem {...item} /></span> | Render the item.<br><br>**Signature:**<br>`function(params: object) => ReactNode`<br>*params:* The props to spread on a PaginationItem. |
3939
| <span class="prop-name">shape</span> | <span class="prop-type">'round'<br>&#124;&nbsp;'rounded'</span> | <span class="prop-default">'round'</span> | The shape of the pagination items. |
4040
| <span class="prop-name">showFirstButton</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, show the first-page button. |
4141
| <span class="prop-name">showLastButton</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, show the last-page button. |

docs/pages/api-docs/slider.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
4141
| <span class="prop-name">onChange</span> | <span class="prop-type">func</span> | | Callback function that is fired when the slider's value changed.<br><br>**Signature:**<br>`function(event: object, value: number \| number[]) => void`<br>*event:* The event source of the callback.<br>*value:* The new value. |
4242
| <span class="prop-name">onChangeCommitted</span> | <span class="prop-type">func</span> | | Callback function that is fired when the `mouseup` is triggered.<br><br>**Signature:**<br>`function(event: object, value: number \| number[]) => void`<br>*event:* The event source of the callback.<br>*value:* The new value. |
4343
| <span class="prop-name">orientation</span> | <span class="prop-type">'horizontal'<br>&#124;&nbsp;'vertical'</span> | <span class="prop-default">'horizontal'</span> | The slider orientation. |
44-
| <span class="prop-name">scale</span> | <span class="prop-type">func</span> | <span class="prop-default">x => x</span> | A transformation function, to change the scale of the slider. |
44+
| <span class="prop-name">scale</span> | <span class="prop-type">func</span> | <span class="prop-default">(x) => x</span> | A transformation function, to change the scale of the slider. |
4545
| <span class="prop-name">step</span> | <span class="prop-type">number</span> | <span class="prop-default">1</span> | The granularity with which the slider can step through values. (A "discrete" slider.) The `min` prop serves as the origin for the valid values. We recommend (max - min) to be evenly divisible by the step.<br>When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop. |
4646
| <span class="prop-name">ThumbComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">'span'</span> | The component used to display the value label. |
4747
| <span class="prop-name">track</span> | <span class="prop-type">'normal'<br>&#124;&nbsp;false<br>&#124;&nbsp;'inverted'</span> | <span class="prop-default">'normal'</span> | The track presentation:<br>- `normal` the track will render a bar representing the slider value. - `inverted` the track will render a bar representing the remaining slider value. - `false` the track will render without a bar. |
4848
| <span class="prop-name">value</span> | <span class="prop-type">number<br>&#124;&nbsp;Array&lt;number&gt;</span> | | The value of the slider. For ranged sliders, provide an array with two values. |
4949
| <span class="prop-name">ValueLabelComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">ValueLabel</span> | The value label component. |
5050
| <span class="prop-name">valueLabelDisplay</span> | <span class="prop-type">'on'<br>&#124;&nbsp;'auto'<br>&#124;&nbsp;'off'</span> | <span class="prop-default">'off'</span> | Controls when the value label is displayed:<br>- `auto` the value label will display when the thumb is hovered or focused. - `on` will display persistently. - `off` will never display. |
51-
| <span class="prop-name">valueLabelFormat</span> | <span class="prop-type">string<br>&#124;&nbsp;func</span> | <span class="prop-default">x => x</span> | The format function the value label's value.<br>When a function is provided, it should have the following signature:<br>- {number} value The value label's value to format - {number} index The value label's index to format |
51+
| <span class="prop-name">valueLabelFormat</span> | <span class="prop-type">string<br>&#124;&nbsp;func</span> | <span class="prop-default">(x) => x</span> | The format function the value label's value.<br>When a function is provided, it should have the following signature:<br>- {number} value The value label's value to format - {number} index The value label's index to format |
5252

5353
The `ref` is forwarded to the root element.
5454

docs/pages/components/material-icons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
33
import Markdown from 'docs/src/pages/components/material-icons/material-icons.md';
44
import SearchIcons from 'docs/src/pages/components/material-icons/SearchIcons';
55

6-
const req = name => {
6+
const req = (name) => {
77
const map = {
88
'material-icons.md': Markdown,
99
'SearchIcons.js': {

docs/pages/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function loadDependencies() {
3131
}
3232

3333
const useStyles = makeStyles(
34-
theme => ({
34+
(theme) => ({
3535
root: {
3636
flex: '1 0 100%',
3737
},
@@ -109,7 +109,7 @@ export default function LandingPage() {
109109

110110
loadDependencies();
111111
}, []);
112-
const t = useSelector(state => state.options.t);
112+
const t = useSelector((state) => state.options.t);
113113
const classes = useStyles();
114114

115115
return (

0 commit comments

Comments
 (0)