Skip to content

Instantly share code, notes, and snippets.

@myobie
Last active August 10, 2020 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myobie/1b72f2e206caa86551941f6161f3a733 to your computer and use it in GitHub Desktop.
Save myobie/1b72f2e206caa86551941f6161f3a733 to your computer and use it in GitHub Desktop.
How to setup a hugo repo (or any static website) with eslint and the standard config
module.exports = {
root: true,
env: {
browser: true,
mocha: true
},
globals: {
expect: true
},
plugins: [],
extends: [
'eslint-config-standard'
],
ignorePatterns: [
'.yarn/**',
'dist/**',
'vendor/**',
'node_modules/**',
'public/**'
],
rules: {
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }]
}
}
{
"name": "website",
"version": "1.0.0",
"description": "The website",
"scripts": {
"clear": "rm -rf public/*",
"dev": "hugo server -w -D --baseUrl=/ --appendPort=false",
"fix": "eslint . --ext .js --fix",
"lint": "eslint . --ext .js"
},
"license": "UNLICENSED",
"dependencies": {},
"devDependencies": {
"eslint": "^7.6.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"postcss-cli": "^7.1.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment