Skip to content

Commit

Permalink
[core] Add jsx, html, css and prisma to prettier extensions (#31161)
Browse files Browse the repository at this point in the history
* Add jsx

* Add html, prisma

* Add Css
  • Loading branch information
Janpot authored Feb 21, 2022
1 parent 368382b commit e6d7d3c
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 133 deletions.
10 changes: 5 additions & 5 deletions docs/public/static/styles/prism-okaidia.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

/* inline code */
code {
padding: .1em;
border-radius: .3em;
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
}

code[class*="language-"] {
code[class*='language-'] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
Expand Down Expand Up @@ -48,7 +48,7 @@ code[class*="language-"] {
}

.namespace {
opacity: .7;
opacity: 0.7;
}

.token.property,
Expand Down Expand Up @@ -112,7 +112,7 @@ code[class*="language-"] {

/* Overrides to reach AA, copied from https://reactjs.org */

code[class*="language-"] {
code[class*='language-'] {
text-shadow: none;
}

Expand Down
172 changes: 91 additions & 81 deletions examples/cdn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,101 +4,111 @@
<title>My page</title>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<script src="https://unpkg.com/react@latest/umd/react.development.js" crossorigin="anonymous"></script>
<script
src="https://unpkg.com/react@latest/umd/react.development.js"
crossorigin="anonymous"
></script>
<script src="https://unpkg.com/react-dom@latest/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@mui/material@latest/umd/material-ui.development.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/babel-standalone@latest/babel.min.js" crossorigin="anonymous"></script>
<script
src="https://unpkg.com/@mui/material@latest/umd/material-ui.development.js"
crossorigin="anonymous"
></script>
<script
src="https://unpkg.com/babel-standalone@latest/babel.min.js"
crossorigin="anonymous"
></script>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
<!-- Icons to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
</head>
<body>
<div id="root"></div>
<script type="text/babel">
const {
colors,
CssBaseline,
ThemeProvider,
Typography,
Container,
createTheme,
Box,
SvgIcon,
Link,
} = MaterialUI;
const {
colors,
CssBaseline,
ThemeProvider,
Typography,
Container,
createTheme,
Box,
SvgIcon,
Link,
} = MaterialUI;

// Create a theme instance.
const theme = createTheme({
palette: {
primary: {
main: '#556cd6',
},
secondary: {
main: '#19857b',
},
error: {
main: colors.red.A400,
},
},
});
// Create a theme instance.
const theme = createTheme({
palette: {
primary: {
main: '#556cd6',
},
secondary: {
main: '#19857b',
},
error: {
main: colors.red.A400,
},
},
});

function LightBulbIcon(props) {
return (
<SvgIcon {...props}>
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z" />
</SvgIcon>
);
}
function LightBulbIcon(props) {
return (
<SvgIcon {...props}>
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z" />
</SvgIcon>
);
}

function ProTip() {
return (
<Typography sx={{ mt: 6, mb: 3 }} color="text.secondary">
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'top' }} />
Pro tip: See more{' '}
<Link href="https://mui.com/getting-started/templates/">
templates
</Link>{' '}
on the MUI documentation.
</Typography>
);
}
function ProTip() {
return (
<Typography sx={{ mt: 6, mb: 3 }} color="text.secondary">
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'top' }} />
Pro tip: See more{' '}
<Link href="https://mui.com/getting-started/templates/">templates</Link> on the MUI
documentation.
</Typography>
);
}

function Copyright() {
return (
<Typography variant="body2" color="text.secondary" align="center">
{'Copyright © '}
<Link color="inherit" href="https://mui.com/">
Your Website
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
);
}
function Copyright() {
return (
<Typography variant="body2" color="text.secondary" align="center">
{'Copyright © '}
<Link color="inherit" href="https://mui.com/">
Your Website
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
);
}

function App() {
return (
<Container maxWidth="sm">
<Box sx={{ my: 4 }}>
<Typography variant="h4" component="h1" gutterBottom>
CDN example
</Typography>
<ProTip />
<Copyright />
</Box>
</Container>
);
}
function App() {
return (
<Container maxWidth="sm">
<Box sx={{ my: 4 }}>
<Typography variant="h4" component="h1" gutterBottom>
CDN example
</Typography>
<ProTip />
<Copyright />
</Box>
</Container>
);
}

ReactDOM.render(
<ThemeProvider theme={theme}>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
<CssBaseline />
<App />
</ThemeProvider>,
document.querySelector('#root'),
);
ReactDOM.render(
<ThemeProvider theme={theme}>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
<CssBaseline />
<App />
</ThemeProvider>,
document.querySelector('#root'),
);
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -26,7 +23,10 @@
-->
<title>React App</title>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -26,7 +23,10 @@
-->
<title>React App</title>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
5 changes: 4 additions & 1 deletion examples/create-react-app-with-typescript/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
-->
<title>My page</title>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
7 changes: 5 additions & 2 deletions examples/create-react-app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -21,7 +21,10 @@
-->
<title>My page</title>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
5 changes: 4 additions & 1 deletion examples/joy-cra-typescript/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
-->
<title>My page</title>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
10 changes: 5 additions & 5 deletions examples/preact/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -26,7 +23,10 @@
-->
<title>React App</title>
<!-- Fonts to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
5 changes: 1 addition & 4 deletions examples/tailwind-css/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down
2 changes: 1 addition & 1 deletion examples/tailwind-css/src/index.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@tailwind components;
@tailwind utilities;
@tailwind utilities;
2 changes: 1 addition & 1 deletion examples/vitejs/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export default function App() {
</Box>
</Container>
);
}
}
2 changes: 1 addition & 1 deletion examples/vitejs/src/Copyright.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export default function Copyright() {
{new Date().getFullYear()}.
</Typography>
);
}
}
2 changes: 1 addition & 1 deletion examples/vitejs/src/ProTip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export default function ProTip() {
the MUI documentation.
</Typography>
);
}
}
7 changes: 4 additions & 3 deletions examples/vitejs/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ ReactDOM.render(
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
<CssBaseline />
<App />
</ThemeProvider>,
</ThemeProvider>
,
</React.StrictMode>,
document.getElementById('root')
)
document.getElementById('root'),
);
Loading

0 comments on commit e6d7d3c

Please sign in to comment.