Last active
October 2, 2018 17:08
-
-
Save ChristianBraybrooke/c6c7691faaf28510abd5c9f66d64fd3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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