You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably a very rare edge case related to how Windows linebreaks are interpreted. It doesn't occur when using normal Unix linebreaks (Sadly not an option on the project I'm working).
I don't expect such rare cases to be a priority or even be fixed. I just want to document it in case someone else falls into the same situation.
What did you do?
New project from Vue CLI v3. Set up Eslint to use plugin:vue/strongly-recommended. Edit component as below and get warning about multiple spaces on the two first characters in the function name.
What did you expect to happen?
After splitting attributes to their own line, there should be no errors or warnings. Using --fix should not do anything to the file.
What actually happened?
➜ vue-eslint git:(master) ✗ ./node_modules/.bin/eslint src/components/HelloWorld.vue
./src/components/HelloWorld.vue
3:13 warning Multiple spaces found before 'yHello"
' vue/no-multi-spaces
✖ 1 problem (0 errors, 1 warning)
0 errors and 1 warning potentially fixable with the `--fix` option.
Eslint starting to remove the function of @click="sayHello" when using VSCode Eslint fix. Doing it from terminal results in an stacktrace
➜ vue-eslint git:(master) ✗ ./node_modules/.bin/eslint src/components/HelloWorld.vue --fix
TypeError: Cannot read property 'range' of null
at TokenStore.getTokenBefore (./node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/index.js:3452:102)
at getFirstAndLastTokens (./node_modules/eslint-plugin-vue/lib/utils/indent-common.js:364:28)
at processNodeList (./node_modules/eslint-plugin-vue/lib/utils/indent-common.js:400:31)
at EventEmitter.VOnExpression (./node_modules/eslint-plugin-vue/lib/utils/indent-common.js:970:7)
at EventEmitter.emit (events.js:188:13)
at NodeEventGenerator.applySelector (./node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/index.js:3077:26)
at NodeEventGenerator.applySelectors (./node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/index.js:3091:22)
at NodeEventGenerator.enterNode (./node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/index.js:3099:14)
at traverse (./node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/index.js:110:13)
at traverse (./node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/index.js:122:13)
It does only happen when the @click is located on the root element. Also, switching the Eslint configuration to use plugin:vue/recommended still give the warning but how the order fixes are executed, it never triggers.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
This is probably a very rare edge case related to how Windows linebreaks are interpreted. It doesn't occur when using normal Unix linebreaks (Sadly not an option on the project I'm working).
I don't expect such rare cases to be a priority or even be fixed. I just want to document it in case someone else falls into the same situation.
Tell us about your environment
Please show your full configuration:
What did you do?
New project from Vue CLI v3. Set up Eslint to use
plugin:vue/strongly-recommended
. Edit component as below and get warning about multiple spaces on the two first characters in the function name.What did you expect to happen?
After splitting attributes to their own line, there should be no errors or warnings. Using
--fix
should not do anything to the file.What actually happened?
Eslint starting to remove the function of
@click="sayHello"
when using VSCode Eslint fix. Doing it from terminal results in an stacktraceIt does only happen when the
@click
is located on the root element. Also, switching the Eslint configuration to useplugin:vue/recommended
still give the warning but how the order fixes are executed, it never triggers.The text was updated successfully, but these errors were encountered: