Skip to content

Instantly share code, notes, and snippets.

@ChristianBraybrooke
Last active October 2, 2018 17:08
Show Gist options
  • Save ChristianBraybrooke/c6c7691faaf28510abd5c9f66d64fd3d to your computer and use it in GitHub Desktop.
Save ChristianBraybrooke/c6c7691faaf28510abd5c9f66d64fd3d to your computer and use it in GitHub Desktop.
// Install via NPM
npm i -D eslint eslint-plugin-vue babel-eslint
// Init eslint
./node_modules/.bin/eslint --init
// Add below to ".eslintrc.json" file in project route
{
"extends": [
"standard",
"plugin:vue/recommended"
],
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 2017,
"sourceType": "module"
}
}
// Add rules to webpackConfig module
module: {
rules: [
{
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
]
}
// Add these scripts in package.json
{
"lint": "./node_modules/.bin/eslint resources/assets/js/ --ext .js,.vue || true",
"lint-fix": "./node_modules/.bin/eslint resources/assets/js/ --ext .js,.vue --fix || true"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment