File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,12 @@ cache:
10
10
before_install :
11
11
- curl -o- -L https://yarnpkg.com/install.sh | bash
12
12
- export PATH="$HOME/.yarn/bin:$PATH"
13
- - curl -o $HOME/gpgkey.asc $GPG_KEY
14
- - gpg --import $HOME/gpgkey.asc
15
- - git config --global user.name 'JounQin'
16
- - git config --global user.email 'admin@1stg.me'
17
- - git config --global commit.gpgsign true
18
- - git config --global tag.gpgsign true
13
+ - git config --global user.name "JounQin"
14
+ - git config --global user.email "admin@1stg.me"
19
15
20
16
install : yarn --frozen-lockfile
21
17
22
18
script :
23
- - set -e
24
19
- yarn lint
25
20
- yarn build
26
21
- yarn test
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " http://json.schemastore.org/lerna" ,
3
- "version" : " 0.9.6 " ,
3
+ "version" : " 0.9.7 " ,
4
4
"npmClient" : " yarn" ,
5
5
"useWorkspaces" : true ,
6
6
"changelog" : {
Original file line number Diff line number Diff line change @@ -196,7 +196,25 @@ export class Parser {
196
196
const value = node . value as string
197
197
198
198
// wrap into single Fragment, so that it won't break on adjacent JSX nodes
199
- const program = this . _eslintParse ( `<>${ value } </>` ) . ast
199
+ let program : AST . Program
200
+
201
+ try {
202
+ program = this . _eslintParse ( `<>${ value } </>` ) . ast
203
+ } catch ( e ) {
204
+ if ( hasProperties < LocationError > ( e , LOC_ERROR_PROPERTIES ) ) {
205
+ const {
206
+ position : { start } ,
207
+ } = node
208
+
209
+ e . index += start . offset - 3
210
+ e . column = e . lineNumber > 1 ? e . column : e . column + start . column - 3
211
+ e . lineNumber += start . line - 1
212
+
213
+ throw e
214
+ }
215
+
216
+ return node
217
+ }
200
218
201
219
const { expression } = program . body [ 0 ] as ExpressionStatement
202
220
@@ -266,7 +284,7 @@ export class Parser {
266
284
} catch ( e ) {
267
285
if ( hasProperties < LocationError > ( e , LOC_ERROR_PROPERTIES ) ) {
268
286
e . index += start
269
- e . column += loc . start . column
287
+ e . column = e . lineNumber > 1 ? e . column : e . column + loc . start . column
270
288
e . lineNumber += startLine
271
289
}
272
290
You can’t perform that action at this time.
0 commit comments