Feel free to take the code to make your own website.
I like to use a linter and a formatter. The linter will allow us to detect bugs early, and the formatter will help us maintain consistency throughout our codebase. With both these extensions working side-by-side, we should be able to build clean and maintainable code.
- Install Homebrew
- Install Node and NPM with
brew install node
- Install yarn. See official Yarn installation instructions.
- Fork then clone this repository
- Install the dependancies with
yarn install
-
Download the ESLint and Prettier extensions for VSCode.
-
Install the ESLint and Prettier libraries into our project. In your project’s root directory, you will want to run:
npm install -D eslint prettier
-
Install the Airbnb config. If you’re using npm 5+, you can run this shortcut to install the config and all of its dependencies:
npx install-peerdeps --dev eslint-config-airbnb
-
Install eslint-config-prettier (disables formatting for ESLint) and eslint-plugin-prettier (allows ESLint to show formatting errors as we type)
npm install -D eslint-config-prettier eslint-plugin-prettier
-
Create
.eslintrc.json
file in your project’s root directory:
{
"extends": ["airbnb", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
},
}
-
Create
.prettierrc
file in your project’s root directory. This will be where you configure your formatting settings. I have added a few of my own preferences below, but I urge you to read more about the Prettier config file -
The last step is to make sure Prettier formats on save. Insert
"editor.formatOnSave"
: true into your User Settings in VSCode.
You can get a local server running by typing: npm start
Get a compiled and optimise build by typing: npm build
DEBUG=* npx @11ty/eleventy --config=app/eleventy/eleventy.config.js