Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error: attributes in 'script' tag in 'vue' file #843

Closed
ilawrencewu opened this issue Nov 28, 2017 · 2 comments
Closed

Parsing error: attributes in 'script' tag in 'vue' file #843

ilawrencewu opened this issue Nov 28, 2017 · 2 comments
Assignees
Labels
type: bug Exceptions and blocking issues during analysis
Milestone

Comments

@ilawrencewu
Copy link

ilawrencewu commented Nov 28, 2017

I installed the SonarJS into SonarQube, and scanned a Vue project, the result snippet as below:
Maybe this is a bug.
SonarJS version: 3.3.0.5702

SonarQube version: 5.6.6

"dependencies": {
"lodash": "4.17.4",
"vue": "2.3.4",
"vue-resource": "1.3.4",
"vue-router": "2.6.0",
"vuex": "2.3.1",
"vue-loader": "11.3.4",
"vue-style-loader": "2.0.5",
"vue-template-compiler": "2.3.4",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^2.6.1"
}

ERROR: Unable to parse file: /data/jenkins/workspace/develop/vueportal/lib/components/picker/src/picker-slot.vue
ERROR: Parse error at line 111 column 1:

101: overflow: visible
102: }
103:
104: .picker-3d .picker-item {
105: transform-origin: center center;
106: backface-visibility: hidden;
107: transition-timing-function: ease-out
108: }
109: </style>
110:
111: <script type="text/babel">
^
112: import draggable from './draggable'
113: import translateUtil from './translate'
114: import { once, addClass, removeClass } from './dom'
115: import emitter from './emitter'
116: import Vue from 'vue'
117: if (!Vue.prototype.$isServer) {
118: require('raf.js')
119: }
120:
121: var rotateElement = function (element, angle) {.....other code}
</script>

It seems that SonarJS cannot recognize the <script> tag.

@vilchik-elena vilchik-elena changed the title ERROR: Unable to parse file: xx.vue Parsing error: attributes in 'script' tag in 'vue' file Nov 28, 2017
@vilchik-elena vilchik-elena added this to the 4.0 milestone Nov 28, 2017
@vilchik-elena vilchik-elena added type: bug Exceptions and blocking issues during analysis parsing labels Nov 28, 2017
@vilchik-elena
Copy link
Contributor

Minimal reproducer

<script someAttr="foo">
console.log("Bar");
</script>

@vilchik-elena
Copy link
Contributor

@ilawrencewu Thanks for this issue! I've added it to next milestone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Exceptions and blocking issues during analysis
Projects
None yet
Development

No branches or pull requests

2 participants