Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(typescript-estree): fix range of assignment in parameter#115

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JamesHenry merged 5 commits intotypescript-eslint:masterfromarmano2:property-assignment-pattern
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletionspackages/parser/tests/lib/__snapshots__/typescript.ts.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21333,12 +21333,12 @@ Object {
"line": 4,
},
"start": Object {
"column":14,
"column":22,
"line": 4,
},
},
"range": Array [
116,
124,
140,
],
"right": Object {
Expand DownExpand Up@@ -21439,12 +21439,12 @@ Object {
"line": 5,
},
"start": Object {
"column":14,
"column":31,
"line": 5,
},
},
"range": Array [
156,
173,
197,
],
"right": Object {
Expand DownExpand Up@@ -24453,12 +24453,12 @@ Object {
"line": 4,
},
"start": Object {
"column":14,
"column":24,
"line": 4,
},
},
"range": Array [
120,
130,
146,
],
"right": Object {
Expand DownExpand Up@@ -24559,12 +24559,12 @@ Object {
"line": 5,
},
"start": Object {
"column":14,
"column":33,
"line": 5,
},
},
"range": Array [
162,
181,
205,
],
"right": Object {
Expand DownExpand Up@@ -25579,12 +25579,12 @@ Object {
"line": 4,
},
"start": Object {
"column":14,
"column":21,
"line": 4,
},
},
"range": Array [
114,
121,
137,
],
"right": Object {
Expand DownExpand Up@@ -25685,12 +25685,12 @@ Object {
"line": 5,
},
"start": Object {
"column":14,
"column":30,
"line": 5,
},
},
"range": Array [
153,
169,
193,
],
"right": Object {
Expand DownExpand Up@@ -26633,12 +26633,12 @@ Object {
"line": 3,
},
"start": Object {
"column":14,
"column":23,
"line": 3,
},
},
"range": Array [
68,
77,
103,
],
"right": Object {
Expand Down
6 changes: 6 additions & 0 deletionspackages/typescript-estree/src/convert.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1318,6 +1318,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
left: parameter,
right: convertChild(node.initializer)
});

if (node.modifiers) {
// AssignmentPattern should not contain modifiers in range
result.range[0] = parameter.range[0];
result.loc = getLocFor(result.range[0], result.range[1], ast);
}
} else {
parameter = result = convert({
node: node.name,
Expand Down
2 changes: 1 addition & 1 deletionpackages/typescript-estree/src/node-utils.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -161,7 +161,7 @@ export function hasModifier(
* @param node TypeScript AST node
* @returns returns last modifier if present or null
*/
export function getLastModifier(node: ts.Node): ts.Node | null {
export function getLastModifier(node: ts.Node): ts.Modifier | null {
return (
(!!node.modifiers &&
!!node.modifiers.length &&
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -341,15 +341,6 @@ tester.addFixturePatternConfig('typescript/basics', {
'abstract-class-with-abstract-method', // babel parse errors
'abstract-class-with-optional-method', // babel parse errors
'declare-class-with-optional-method', // babel parse errors
/**
* Was expected to be fixed by PR into Babel: https://github.com/babel/babel/pull/9284
* But not fixed in Babel 7.3
* TODO: Investigate differences
*/
'class-with-private-parameter-properties',
'class-with-protected-parameter-properties',
'class-with-public-parameter-properties',
'class-with-readonly-parameter-properties',
/**
* Was expected to be fixed by PR into Babel: https://github.com/babel/babel/pull/9302
* But not fixed in Babel 7.3
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21291,12 +21291,12 @@ Object {
"line": 4,
},
"start": Object {
"column":14,
"column":22,
"line": 4,
},
},
"range": Array [
116,
124,
140,
],
"right": Object {
Expand DownExpand Up@@ -21397,12 +21397,12 @@ Object {
"line": 5,
},
"start": Object {
"column":14,
"column":31,
"line": 5,
},
},
"range": Array [
156,
173,
197,
],
"right": Object {
Expand DownExpand Up@@ -24408,12 +24408,12 @@ Object {
"line": 4,
},
"start": Object {
"column":14,
"column":24,
"line": 4,
},
},
"range": Array [
120,
130,
146,
],
"right": Object {
Expand DownExpand Up@@ -24514,12 +24514,12 @@ Object {
"line": 5,
},
"start": Object {
"column":14,
"column":33,
"line": 5,
},
},
"range": Array [
162,
181,
205,
],
"right": Object {
Expand DownExpand Up@@ -25533,12 +25533,12 @@ Object {
"line": 4,
},
"start": Object {
"column":14,
"column":21,
"line": 4,
},
},
"range": Array [
114,
121,
137,
],
"right": Object {
Expand DownExpand Up@@ -25639,12 +25639,12 @@ Object {
"line": 5,
},
"start": Object {
"column":14,
"column":30,
"line": 5,
},
},
"range": Array [
153,
169,
193,
],
"right": Object {
Expand DownExpand Up@@ -26586,12 +26586,12 @@ Object {
"line": 3,
},
"start": Object {
"column":14,
"column":23,
"line": 3,
},
},
"range": Array [
68,
77,
103,
],
"right": Object {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp