Skip to content

Commit

Permalink
Prettify all the things (#16)
Browse files Browse the repository at this point in the history
* Tweak Prettier config to be a bit more explicit
* Remove bootstrap-5/dist folder
* Ignore folders named build, dist or out-tsc in templates
* Prettify all remaining templates
  • Loading branch information
Florens Verschelde authored Sep 1, 2023
1 parent 3b1774c commit 638f23f
Show file tree
Hide file tree
Showing 46 changed files with 334 additions and 284 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/package-lock.json
*/pnpm-lock.yaml
*/yarn.lock
*/build/*
*/dist/*
*/out-tsc/*

# Ignore everywhere
._*
Expand Down
30 changes: 4 additions & 26 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
# Ignore repository config
/*.*
/LICENSE

# Ignore specific templates
/bootstrap-5
/egg
/express-simple
/graphql
/gsap-*
/json-graphql-server
/json-server
/koa
/nextjs
/nodemon
/quasar
/slidev
/sveltekit
/tres
# Generated files
**/package-lock.json

# Ignore specific file formats
# Prettier formatting of HTML is questionable, let's skip it for now
**/*.html

# Skipping Markdown as well, as it may contain custom DSLs that Prettier doesn't handle well
**/*.md
**/*.mdx

# Maybe skip formatting templating languages too
**/*.svelte
**/*.vue

# We maybe don't want to have those files in the first place?
**/dist/*
**/build/*
**/.vscode/*
**/package-lock.json
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": ["**/.stackblitzrc"],
"files": ["**/.prettierrc", "**/.stackblitzrc"],
"options": { "parser": "json" }
},
{
Expand Down
2 changes: 2 additions & 0 deletions bootstrap-5/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
2 changes: 1 addition & 1 deletion bootstrap-5/.stackblitzrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"startCommand": "npm start"
}
}
32 changes: 0 additions & 32 deletions bootstrap-5/dist/main.js

This file was deleted.

2 changes: 1 addition & 1 deletion bootstrap-5/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// $secondary: #e8d21d;
// $border-radius: 1px;

@import "../node_modules/bootstrap/scss/bootstrap";
@import '../node_modules/bootstrap/scss/bootstrap';
17 changes: 7 additions & 10 deletions bootstrap-5/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,29 @@ module.exports = {
devServer: {
open: 'google-chrome',
port: 9000,
contentBase: [
path.join(__dirname, 'src'),
path.join(__dirname, 'dist'),
],
contentBase: [path.join(__dirname, 'src'), path.join(__dirname, 'dist')],
watchContentBase: true,
liveReload: true
liveReload: true,
},
module: {
rules: [
{
test: /\.scss$/i,
use: [
// Creates `style` nodes from JS strings
"style-loader",
'style-loader',
// Translates CSS into CommonJS
"css-loader",
'css-loader',
// Compiles Sass to CSS
{
loader: "sass-loader",
loader: 'sass-loader',
options: {
// Prefer `dart-sass`
implementation: require.resolve("sass"),
implementation: require.resolve('sass'),
},
},
],
},
],
},
};
};
2 changes: 1 addition & 1 deletion egg/.stackblitzrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"installDependencies": true,
"startCommand": "npm start"
}
}
2 changes: 1 addition & 1 deletion egg/app/router.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @param {Egg.Application} app - egg application
*/
module.exports = app => {
module.exports = (app) => {
const { router, controller } = app;
router.get('/', controller.home.index);
};
6 changes: 3 additions & 3 deletions egg/config/config.default.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @param {Egg.EggAppInfo} appInfo app info
*/
module.exports = appInfo => {
module.exports = (appInfo) => {
/**
* built-in config
* @type {Egg.EggAppConfig}
Expand All @@ -15,8 +15,8 @@ module.exports = appInfo => {
defaultViewEngine: 'nunjucks',
mapping: {
'.nj': 'nunjucks',
'.tpl': 'nunjucks'
}
'.tpl': 'nunjucks',
},
};

return config;
Expand Down
4 changes: 2 additions & 2 deletions egg/config/config.local.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
exports.security = {
xframe: {
enable: false
}
enable: false,
},
};
4 changes: 2 additions & 2 deletions egg/config/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
module.exports = {
nunjucks: {
enable: true,
package: 'egg-view-nunjucks'
}
package: 'egg-view-nunjucks',
},
};
6 changes: 3 additions & 3 deletions egg/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ egg
.start({
workers: 1,
port: 3000,
mode: 'single'
mode: 'single',
})
.then(app => {
.then((app) => {
app.listen(3000);
console.log('listen 3000');
})
.catch(err => {
.catch((err) => {
console.error(err);
});
2 changes: 1 addition & 1 deletion express-simple/.stackblitzrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"startCommand": "npm start"
}
}
6 changes: 3 additions & 3 deletions express-simple/static/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
h1 {
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
h1 {
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
2 changes: 1 addition & 1 deletion graphql/.stackblitzrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"installDependencies": true,
"startCommand": "npx nodemon server.js"
}
}
4 changes: 2 additions & 2 deletions graphql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var schema = buildSchema(`
var root = {
hello: () => {
return 'Hello, world!';
}
},
};

var app = express();
Expand All @@ -22,7 +22,7 @@ app.use(
graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true
graphiql: true,
})
);
app.listen(4000);
Expand Down
18 changes: 9 additions & 9 deletions graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "node-app",
"version": "0.0.0",
"scripts": {},
"dependencies": {
"express": "^4.17.1",
"express-graphql": "^0.12.0",
"graphql": "^15.5.0",
"nodemon": "^2.0.7"
}
"name": "node-app",
"version": "0.0.0",
"scripts": {},
"dependencies": {
"express": "^4.17.1",
"express-graphql": "^0.12.0",
"graphql": "^15.5.0",
"nodemon": "^2.0.7"
}
}
6 changes: 3 additions & 3 deletions gsap-next/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../styles/globals.css'
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}

export default MyApp
export default MyApp;
2 changes: 1 addition & 1 deletion gsap-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"devDependencies": {
"react-scripts": "latest"
}
}
}
8 changes: 4 additions & 4 deletions gsap-react/src/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url("https://fonts.googleapis.com/css2?family=Signika+Negative:wght@400;600&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Signika+Negative:wght@400;600&display=swap');

* {
margin: 0;
Expand Down Expand Up @@ -474,7 +474,7 @@ button {
-moz-border-radius: 4;
border-radius: 4px;
padding: 12px 25px;
font-family: "Signika Negative", sans-serif;
font-family: 'Signika Negative', sans-serif;
text-transform: uppercase;
font-weight: 600;
cursor: pointer;
Expand All @@ -497,7 +497,7 @@ body {
height: 100%;
-webkit-overflow-scrolling: touch;
overflow-scrolling: touch;
font-family: "Signika Negative", sans-serif, Arial;
font-family: 'Signika Negative', sans-serif, Arial;
}

.panel {
Expand Down Expand Up @@ -585,7 +585,7 @@ body {
height: auto;
background-color: var(--dark);
color: var(--light);
font-family: "Signika Negative", sans-serif;
font-family: 'Signika Negative', sans-serif;
}

.header {
Expand Down
Loading

0 comments on commit 638f23f

Please sign in to comment.