This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
JSXSpreadChild
and tool to build keys out of AST definiti…
…ons (#36) * refactor: Alphabetize for easier comparisons * chore: tool to build keys out of AST definitions Also: 1. Removes `ExperimentalRestProperty`, `ExperimentalSpreadProperty` 2. Adds `JSXSpreadChild` * refactor: sort alphabetically after known keys * refactor: restore backward compatible experimental keys * refactor: put backward compatible keys into own file * refactor: file rename * refactor: drop `propertiesToIgnore` in favor of `getKeys` blacklist * refactor: allow for more primitiveish types; fix error Also: - test: improve coverage * refactor: drop optional chaining fix for Node 12 * refactor: update testing/build devDeps. * refactor: exclude keys if not leading to an object with a non-comment type * refactor: no need for async on function * refactor: Remove commented out properties * refactor: Avoid unnecessary await Co-authored-by: Milos Djermanovic <[email protected]> Co-authored-by: Milos Djermanovic <[email protected]>
- Loading branch information
1 parent
4beb7a7
commit 6ece4bd
Showing
17 changed files
with
993 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface Something extends BadSomething { | ||
type: "Something"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface Statement {} | ||
|
||
export interface StaticBlock extends BadTypeParam<Statement, 'type'> { | ||
type: "StaticBlock"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface StaticBlock extends Omit<SomeUnknownStatement, 'type'> { | ||
type: "StaticBlock"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
interface BadExpression { | ||
type: undefined; | ||
} | ||
|
||
export interface NewFangledExpression { | ||
type: "NewFangledExpression"; | ||
right: BadExpression; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface SomeExpression { | ||
type: "SomeExpression"; | ||
someProperty: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface NewFangledExpression { | ||
type: "NewFangledExpression"; | ||
right: BadExpression; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export type AssignmentOperator = "="; | ||
interface Pattern { | ||
type: "Pattern" | ||
}; | ||
interface MemberExpression { | ||
type: "MemberExpression" | ||
}; | ||
interface Expression { | ||
type: "Expression" | ||
}; | ||
|
||
export interface AssignmentExpression { | ||
type: "AssignmentExpression"; | ||
operator: AssignmentOperator; | ||
down: Expression; | ||
up: Expression; | ||
left: Pattern | MemberExpression; | ||
right: Expression; | ||
nontraversable: RegExp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export type AssignmentOperator = "="; | ||
interface Pattern { | ||
type: "Pattern" | ||
}; | ||
interface MemberExpression { | ||
type: "MemberExpression" | ||
}; | ||
interface Expression { | ||
type: "Expression" | ||
}; | ||
|
||
export interface AssignmentExpression { | ||
type: "AssignmentExpression"; | ||
operator: AssignmentOperator; | ||
up: Expression; | ||
left: Pattern | MemberExpression; | ||
down: Expression; | ||
right: Expression; | ||
nontraversable: RegExp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export type AssignmentOperator = "="; | ||
|
||
interface IgnoreBase { | ||
type: "Line"; | ||
} | ||
|
||
type AnotherIgnore = IgnoreBase; | ||
|
||
interface BasePattern { | ||
type: "Pattern" | ||
}; | ||
interface IgnoreChild extends Omit<BasePattern, "type"> { | ||
}; | ||
|
||
interface Pattern { | ||
type: "Pattern" | ||
}; | ||
interface MemberExpression { | ||
type: "MemberExpression" | ||
}; | ||
interface Expression { | ||
type: "Expression" | ||
}; | ||
|
||
export interface AssignmentExpression { | ||
type: "AssignmentExpression"; | ||
ignore: IgnoreChild; | ||
anotherIgnore: AnotherIgnore; | ||
operator: AssignmentOperator; | ||
up: Expression; | ||
down: Expression; | ||
left: Pattern | MemberExpression; | ||
right: Expression; | ||
nontraversable: RegExp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export type AssignmentOperator = "="; | ||
interface Pattern { | ||
type: "Pattern" | ||
}; | ||
interface MemberExpression { | ||
type: "MemberExpression" | ||
}; | ||
interface Expression { | ||
type: "Expression" | ||
}; | ||
|
||
export interface NewFangledExpression { | ||
type: "NewFangledExpression"; | ||
operator: AssignmentOperator; | ||
up: Expression; | ||
down: Expression; | ||
left: Pattern | MemberExpression; | ||
right: Expression; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface IgnoredStatement { | ||
type: "IgnoredStatement" | ||
} | ||
export interface AnotherStatement { | ||
type: "AnotherStatement"; | ||
anotherToIgnore: IgnoredStatement; | ||
} | ||
|
||
export interface StaticBlock extends Omit<AnotherStatement, 'type' | 'anotherToIgnore'> { | ||
type: "StaticBlock"; | ||
} |
Oops, something went wrong.