Tell us about your environment
Please show your full configuration:
module.exports = {
root: true,
extends: [
'plugin:flowtype/recommended',
'plugin:vue/recommended',
'prettier',
'prettier/flowtype',
],
plugins: ['flowtype', 'vue', 'prettier'],
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
unicodeCodePointEscapes: true,
globalReturn: true,
jsx: true,
},
},
env: {
browser: true,
node: true,
// commonjs: true,
es6: true,
},
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
jsxBracketSameLine: true,
},
],
},
};
What did you do? Please include the actual source code causing the issue.
I'm trying to set up Atom to report all ESlint errors using Prettier-Atom and make it compatible with Vue and Flow.
packages.json
"devDependencies": {
"babel-eslint": "^8.2.3",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-flowtype": "^2.46.3",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-vue": "^4.5.0",
"flow-bin": "^0.71.0",
"prettier": "^1.12.1",
"prettier-eslint": "^8.8.1"
},
<template>
<p>I'm made with Flow and a bunch of other cool stuff! {{ defined }}</p>
<a @click="actionDefined">Submit this {{ NotDefined }}.</a>
<a @click="actionUndefined">Looks like this one won't work.</a>
</template>
<script>
export default {
created() {
console.log(randomThing)
},
data() {
return {
defined: "boop!",
}
},
methods: {
async actionDefined() {
console.log("yay")
},
}
}
</script>
What did you expect to happen?
No ELIFECYCLE on linting.
What actually happened? Please include the actual, raw output from ESLint.
✘ jer@desktop  /media/DarkHawk/srv/NodesProjects/NJS-social/eslint-vue-prettier-flow  npm run lint (eslint -c .eslintrc.js --ext .js,.vue ./)
> [email protected] lint /media/DarkHawk/srv/NodesProjects/NJS-social/eslint-vue-prettier-flow
> eslint -c .eslintrc.js --ext .js,.vue ./
/media/DarkHawk/srv/NodesProjects/NJS-social/eslint-vue-prettier-flow/test.vue
4:3 error The template root requires exactly one element vue/valid-template-root
10:29 error Insert `;` prettier/prettier
12:3 error The "data" property should be above the "created" property on line 9 vue/order-in-components
14:16 error Replace `"boop!"` with `'boop!'` prettier/prettier
15:6 error Insert `;` prettier/prettier
19:19 error Replace `"yay")` with `'yay');` prettier/prettier
21:4 error Insert `,` prettier/prettier
22:2 error Insert `;` prettier/prettier
✖ 8 problems (8 errors, 0 warnings)
7 errors, 0 warnings potentially fixable with the `--fix` option.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint: `eslint -c .eslintrc.js --ext .js,.vue ./`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jer/.npm/_logs/2018-04-28T09_31_01_113Z-debug.log
I _think_ the ELIFECYCLE error occurs because ESLint reports errors, and it exits with 1 if that happens so that CIs and test scripts will fail. If you fix all of the errors, ESLint will exit with 0 and the error message should go away.
Oh, that would make sense! Ok then, no worries! YAY I got it working... finally.
If you got it working, don’t forget to close the issue :)
Yup sorry about that, I thought I did
Most helpful comment
Oh, that would make sense! Ok then, no worries! YAY I got it working... finally.