Skip to content

Commit

Permalink
feat: warn on deprecated AST property accesses
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Feb 24, 2023
1 parent cbb8fed commit 0c7af52
Show file tree
Hide file tree
Showing 80 changed files with 948 additions and 4,061 deletions.
5 changes: 5 additions & 0 deletions docs/architecture/TypeScript-ESTree.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ interface ParseOptions {
*/
comment?: boolean;

/**
* Whether deprecated AST properties should skip calling console.warn on accesses.
*/
suppressDeprecatedPropertyWarnings?: boolean;

/**
* An array of modules to turn explicit debugging on for.
* - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,6 @@ Program {
end: { column: 29, line: 1 },
},
},
superTypeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
type: "TSStringKeyword",
range: [22, 28],
loc: {
start: { column: 22, line: 1 },
end: { column: 28, line: 1 },
},
},
],
range: [21, 29],
loc: {
start: { column: 21, line: 1 },
end: { column: 29, line: 1 },
},
},
range: [0, 32],
loc: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,7 @@ exports[`AST Fixtures declaration ClassDeclaration extends-type-param AST Alignm
},
},
- superTypeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSStringKeyword {
- type: 'TSStringKeyword',
-
- range: [22, 28],
- loc: {
- start: { column: 22, line: 1 },
- end: { column: 28, line: 1 },
- },
- },
- ],
-
- range: [21, 29],
- loc: {
- start: { column: 21, line: 1 },
- end: { column: 29, line: 1 },
- },
- },
superTypeParameters: TSTypeParameterInstantiation {
+ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,6 @@ Program {
end: { column: 27, line: 1 },
},
},
superTypeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "T",
range: [25, 26],
loc: {
start: { column: 25, line: 1 },
end: { column: 26, line: 1 },
},
},
range: [25, 26],
loc: {
start: { column: 25, line: 1 },
end: { column: 26, line: 1 },
},
},
],
range: [24, 27],
loc: {
start: { column: 24, line: 1 },
end: { column: 27, line: 1 },
},
},
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
params: Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
},
},
- superTypeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSTypeReference {
- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'T',
-
- range: [25, 26],
- loc: {
- start: { column: 25, line: 1 },
- end: { column: 26, line: 1 },
- },
- },
-
- range: [25, 26],
- loc: {
- start: { column: 25, line: 1 },
- end: { column: 26, line: 1 },
- },
- },
- ],
-
- range: [24, 27],
- loc: {
- start: { column: 24, line: 1 },
- end: { column: 27, line: 1 },
- },
- },
superTypeParameters: TSTypeParameterInstantiation {
+ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,6 @@ Program {
end: { column: 34, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
type: "TSStringKeyword",
range: [147, 153],
loc: {
start: { column: 35, line: 4 },
end: { column: 41, line: 4 },
},
},
],
range: [146, 154],
loc: {
start: { column: 34, line: 4 },
end: { column: 42, line: 4 },
},
},
range: [139, 154],
loc: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,17 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSStringKeyword {
- type: 'TSStringKeyword',
-
- range: [147, 153],
- loc: {
- start: { column: 35, line: 4 },
- end: { column: 41, line: 4 },
- },
- },
- ],
-
- range: [146, 154],
- loc: {
- start: { column: 34, line: 4 },
- end: { column: 42, line: 4 },
- },
- },
typeName: Identifier {
type: 'Identifier',
name: 'Promise',
range: [139, 146],
loc: {
start: { column: 27, line: 4 },
end: { column: 34, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Promise',
+
+ range: [139, 146],
+ loc: {
+ start: { column: 27, line: 4 },
+ end: { column: 34, line: 4 },
+ },
+ },
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
Expand All @@ -98,6 +79,16 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
loc: {
start: { column: 34, line: 4 },
end: { column: 42, line: 4 },
- },
- },
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [139, 146],
- loc: {
- start: { column: 27, line: 4 },
- end: { column: 34, line: 4 },
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,6 @@ Program {
end: { column: 26, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSStringKeyword {
type: "TSStringKeyword",
range: [139, 145],
loc: {
start: { column: 27, line: 4 },
end: { column: 33, line: 4 },
},
},
],
range: [138, 146],
loc: {
start: { column: 26, line: 4 },
end: { column: 34, line: 4 },
},
},
range: [131, 146],
loc: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,17 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSStringKeyword {
- type: 'TSStringKeyword',
-
- range: [139, 145],
- loc: {
- start: { column: 27, line: 4 },
- end: { column: 33, line: 4 },
- },
- },
- ],
-
- range: [138, 146],
- loc: {
- start: { column: 26, line: 4 },
- end: { column: 34, line: 4 },
- },
- },
typeName: Identifier {
type: 'Identifier',
name: 'Promise',
range: [131, 138],
loc: {
start: { column: 19, line: 4 },
end: { column: 26, line: 4 },
},
},
typeParameters: TSTypeParameterInstantiation {
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Promise',
+
+ range: [131, 138],
+ loc: {
+ start: { column: 19, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
Expand All @@ -96,6 +77,16 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
loc: {
start: { column: 26, line: 4 },
end: { column: 34, line: 4 },
- },
- },
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [131, 138],
- loc: {
- start: { column: 19, line: 4 },
- end: { column: 26, line: 4 },
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,55 +85,6 @@ Program {
end: { column: 40, line: 3 },
},
},
superTypeParameters: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: Array [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "C",
range: [108, 109],
loc: {
start: { column: 35, line: 3 },
end: { column: 36, line: 3 },
},
},
range: [108, 109],
loc: {
start: { column: 35, line: 3 },
end: { column: 36, line: 3 },
},
},
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
name: "D",
range: [111, 112],
loc: {
start: { column: 38, line: 3 },
end: { column: 39, line: 3 },
},
},
range: [111, 112],
loc: {
start: { column: 38, line: 3 },
end: { column: 39, line: 3 },
},
},
],
range: [107, 113],
loc: {
start: { column: 34, line: 3 },
end: { column: 40, line: 3 },
},
},
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
params: Array [
Expand Down

0 comments on commit 0c7af52

Please sign in to comment.