Skip to content

Commit a98bf9d

Browse files
committed
fix: handle loc and range could be undefined for babel-eslint
1 parent 056e00d commit a98bf9d

File tree

5 files changed

+97
-139
lines changed

5 files changed

+97
-139
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const tsNode = require('ts-node')
33
tsNode.register({
44
compilerOptions: {
55
module: 'commonjs',
6+
pretty: true,
67
},
78
transpileOnly: true,
89
})

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ before_install:
1818
install: yarn --frozen-lockfile
1919

2020
script:
21-
- yarn lint
2221
- yarn test
23-
- yarn build
22+
- yarn lint
2423

2524
after_success:
2625
- yarn global add codecov codacy-coverage

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@
2626
"devDependencies": {
2727
"@1stg/babel-preset": "^0.7.10",
2828
"@1stg/commitlint-config": "^0.1.2",
29-
"@1stg/eslint-config": "^0.13.1",
29+
"@1stg/eslint-config": "^0.13.2",
3030
"@1stg/husky-config": "^0.3.2",
3131
"@1stg/lint-staged": "^0.8.11",
3232
"@1stg/prettier-config": "^0.4.3",
3333
"@1stg/remark-config": "^0.2.2",
3434
"@1stg/tsconfig": "^0.6.1",
35-
"@1stg/tslint-config": "^0.4.3",
35+
"@1stg/tslint-config": "^0.4.4",
3636
"@babel/core": "^7.6.4",
3737
"@commitlint/cli": "^8.2.0",
3838
"@pkgr/rollup": "^0.3.0",
3939
"@types/cosmiconfig": "^5.0.3",
4040
"@types/eslint": "^6.1.2",
4141
"@types/jest": "^24.0.19",
42-
"@types/node": "^12.11.2",
42+
"@types/node": "^12.11.5",
4343
"@types/react": "^16.9.9",
4444
"@types/rebass": "^4.0.3",
4545
"@types/unist": "^2.0.3",
@@ -48,12 +48,12 @@
4848
"eslint-plugin-mdx": "link:packages/eslint-plugin-mdx/src",
4949
"husky": "^3.0.9",
5050
"jest": "^24.9.0",
51-
"lerna": "^3.18.2",
51+
"lerna": "^3.18.3",
5252
"lerna-changelog": "^0.8.2",
5353
"lint-staged": "^9.4.2",
5454
"npm-run-all": "^4.1.5",
5555
"prettier": "1.18.2",
56-
"react": "^16.10.2",
56+
"react": "^16.11.0",
5757
"rollup": "^1.25.1",
5858
"ts-jest": "^24.1.0",
5959
"ts-node": "^8.4.1",

packages/eslint-mdx/src/parser.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,13 @@ export class Parser {
274274
return nodes
275275
}
276276
const {
277-
loc: { start, end },
278-
range,
277+
start: nodeStart,
278+
end: nodeEnd,
279+
loc: { start, end } = {
280+
start: { column: nodeStart, line: 1 },
281+
end: { column: nodeEnd, line: 1 },
282+
},
283+
range = [nodeStart, nodeEnd],
279284
} = jsNode
280285
const startLine = line + start.line - 1
281286
const endLine = line + end.line - 1

0 commit comments

Comments
 (0)