Skip to content

Commit 35999bb

Browse files
authored
[core] Format all ts files (#20233)
1 parent 3a64fe1 commit 35999bb

File tree

5 files changed

+53
-40
lines changed

5 files changed

+53
-40
lines changed

packages/material-ui-styles/src/defaultTheme/defaultTheme.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ declare module '@material-ui/styles' {
1313
}
1414

1515
{
16-
makeStyles(theme => {
16+
makeStyles((theme) => {
1717
// $ExpectType string
1818
const value = theme.myProperty;
1919

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import { createMuiTheme, makeStyles } from '@material-ui/core/styles';
22

33
{
4-
const theme = createMuiTheme({
5-
mixins: {
6-
toolbar: {
7-
background: '#fff',
8-
minHeight: 36,
9-
'@media (min-width:0px) and (orientation: landscape)': {
10-
minHeight: 24
11-
},
12-
'@media (min-width:600px)': {
13-
minHeight: 48
14-
}
15-
},
16-
}
17-
});
18-
19-
const useStyles = makeStyles(theme => ({
20-
appBarSpacer: theme.mixins.toolbar,
21-
toolbarIcon: {
22-
display: 'flex',
23-
alignItems: 'center',
24-
justifyContent: 'flex-end',
25-
padding: '0 8px',
26-
...theme.mixins.toolbar,
4+
const theme = createMuiTheme({
5+
mixins: {
6+
toolbar: {
7+
background: '#fff',
8+
minHeight: 36,
9+
'@media (min-width:0px) and (orientation: landscape)': {
10+
minHeight: 24,
11+
},
12+
'@media (min-width:600px)': {
13+
minHeight: 48,
2714
},
28-
}));
15+
},
16+
},
17+
});
18+
19+
const useStyles = makeStyles((theme) => ({
20+
appBarSpacer: theme.mixins.toolbar,
21+
toolbarIcon: {
22+
display: 'flex',
23+
alignItems: 'center',
24+
justifyContent: 'flex-end',
25+
padding: '0 8px',
26+
...theme.mixins.toolbar,
27+
},
28+
}));
2929
}

packages/material-ui/test/typescript/colors.spec.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
import { colors, Color } from '@material-ui/core';
22

33
const {
4-
amber, blue, blueGrey,
5-
brown, cyan, deepOrange,
6-
deepPurple, green, grey,
7-
indigo, lightBlue, lightGreen,
8-
lime, orange, pink,
9-
purple, red, teal,
10-
yellow, common
4+
amber,
5+
blue,
6+
blueGrey,
7+
brown,
8+
cyan,
9+
deepOrange,
10+
deepPurple,
11+
green,
12+
grey,
13+
indigo,
14+
lightBlue,
15+
lightGreen,
16+
lime,
17+
orange,
18+
pink,
19+
purple,
20+
red,
21+
teal,
22+
yellow,
23+
common,
1124
} = colors;
1225

1326
const colorList: Color[] = [

scripts/generateProptypes.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ async function generateProptypes(
4343
return GenerateResult.NoComponent;
4444
}
4545

46-
proptypes.body.forEach(component => {
47-
component.types.forEach(prop => {
46+
proptypes.body.forEach((component) => {
47+
component.types.forEach((prop) => {
4848
if (prop.name === 'classes' && prop.jsDoc) {
4949
prop.jsDoc += '\nSee [CSS API](#css) below for more details.';
5050
} else if (prop.name === 'children' && !prop.jsDoc) {
@@ -100,7 +100,7 @@ async function run() {
100100
[
101101
path.resolve(__dirname, '../packages/material-ui/src'),
102102
path.resolve(__dirname, '../packages/material-ui-lab/src'),
103-
].map(folderPath =>
103+
].map((folderPath) =>
104104
glob('+([A-Z])*/+([A-Z])*.d.ts', {
105105
absolute: true,
106106
cwd: folderPath,
@@ -111,7 +111,7 @@ async function run() {
111111
const files = _.flatten(allFiles)
112112
// Filter out files where the directory name and filename doesn't match
113113
// Example: Modal/ModalManager.d.ts
114-
.filter(filePath => {
114+
.filter((filePath) => {
115115
const folderName = path.basename(path.dirname(filePath));
116116
const fileName = path.basename(filePath, '.d.ts');
117117

@@ -120,7 +120,7 @@ async function run() {
120120

121121
const program = ttp.createProgram(files, tsconfig);
122122

123-
const promises = files.map<Promise<GenerateResult>>(async tsFile => {
123+
const promises = files.map<Promise<GenerateResult>>(async (tsFile) => {
124124
const jsFile = tsFile.replace('.d.ts', '.js');
125125

126126
if (!ignoreCache && (await fse.stat(jsFile)).mtimeMs > (await fse.stat(tsFile)).mtimeMs) {
@@ -140,7 +140,7 @@ async function run() {
140140
}
141141

142142
console.log('--- Summary ---');
143-
const groups = _.groupBy(results, x => x);
143+
const groups = _.groupBy(results, (x) => x);
144144

145145
_.forOwn(groups, (count, key) => {
146146
console.log('%s: %d', GenerateResult[(key as unknown) as GenerateResult], count.length);
@@ -149,7 +149,7 @@ async function run() {
149149
console.log('Total: %d', results.length);
150150
}
151151

152-
run().catch(error => {
152+
run().catch((error) => {
153153
console.error(error);
154154
process.exit(1);
155155
});

scripts/prettier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function runPrettier(options) {
2424
.filter((notEmpty) => notEmpty);
2525

2626
const files = glob
27-
.sync('**/*.{js,tsx,d.ts}', { ignore: ['**/node_modules/**', ...ignoredFiles] })
27+
.sync('**/*.{js,tsx,ts}', { ignore: ['**/node_modules/**', ...ignoredFiles] })
2828
.filter((f) => !changedFiles || changedFiles.has(f));
2929

3030
if (!files.length) {

0 commit comments

Comments
 (0)