Skip to content

Commit

Permalink
next 12.1 (#34)
Browse files Browse the repository at this point in the history
* update dependcies

* now uses nextjs recommended jest setup

* add eslint-plugin-testing-library

* tailwind 2.0 now 3.0

* update readme
  • Loading branch information
agcty authored Mar 4, 2022
1 parent db2a680 commit f76e963
Show file tree
Hide file tree
Showing 14 changed files with 1,605 additions and 2,723 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": ["jest-dom", "unused-imports", "prettier"],
"plugins": ["testing-library", "unused-imports", "prettier"],
"extends": [
"next/core-web-vitals",
"plugin:jest-dom/recommended",
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ That being said I invite you to leave your critique about this template. If ther

## Features

- Fast design workflow with Tailwind CSS 2.0
- Fast design workflow with Tailwind CSS 3.0
- write css like the cool kids
- unused classes are purged automatically = really small css bundle size
- TypeScript
- typed JavaScript
- drastically reduces errors
- #1 must have in any web-dev project
- Customizable ESLint config
- AirBnB code guidelines + prettier rules
- Code formatting with Prettier
- Code is auto-formatted on save
- Inter font
Expand Down Expand Up @@ -140,7 +139,6 @@ If you don't need or want this dependency you can safely remove it.
| `tailwind.config.js` | TailwindCSS config. Adds new sizes, shadows, borders etc. to your tailwind classes. |
| `postcss.config.js` | Tells your project to include TailwindCSS in build chain. |
| `prettier.config.js` | Rules for formatting your code. E.g: indent code 6 spaces instead of 4 |
| `babelrc.js` | Extends the Next.js babel config and defines absolute imports. |
| `.vscode/settings.json` | Custom settings for your VSCode workspace. Tells VSCode to auto-format code on save. |

### Changing the font
Expand All @@ -163,17 +161,16 @@ extend: {
}
```
As of Next 10.0.2 google fonts are optimized automatically: https://nextjs.org/blog/next-10-2#automatic-webfont-optimization
As of Next 10.0.2 google fonts are optimized automatically: <https://nextjs.org/blog/next-10-2#automatic-webfont-optimization>
Tip: The font you choose should have at least these weights: 400, 500, 600, 700, 800. You need these weights for the tailwind font classes to have an effect. E.g if you don't include the weight 500, the class "font-medium" won't have any effect.
### Configuring ESLint rules
If you need additional rules or want to turn off specific rules just edit `.eslintrc.js`. Only change the order of plugins and items in the "extends" array if you know what you're doing as this can have unexpected side effects: Items on the bottom ovverride the former items. This is the intended behaviour so you can extend and configure existing rules easily. For example first we add the popular airbnb rules and then have prettier ovverride some of these rules so code formatting doesn't interfere with other rules.
If you need additional rules or want to turn off specific rules just edit `.eslintrc.js`. Only change the order of plugins and items in the "extends" array if you know what you're doing as this can have unexpected side effects: Items lower down the list override previous extensions. This is the intended behaviour so you can extend and configure existing rules easily.
### Adding new absolute import paths
This will instruct Next.js to set up a new alias to your specific folder. If you try to import a file with @myalias now it will still throw an error however because we need to tell our IDE that this path actually exists:
Add path in `.tsconfig`
Expand Down
Loading

1 comment on commit f76e963

@vercel
Copy link

@vercel vercel bot commented on f76e963 Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.