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
feat: add JSXSpreadChild
and tool to build keys out of AST definitions
#36
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c57689f
refactor: Alphabetize for easier comparisons
brettz9 8739546
chore: tool to build keys out of AST definitions
brettz9 ee6fc73
refactor: sort alphabetically after known keys
brettz9 55c7100
refactor: restore backward compatible experimental keys
brettz9 b75fa97
refactor: put backward compatible keys into own file
brettz9 629146f
refactor: file rename
brettz9 b156a70
refactor: drop `propertiesToIgnore` in favor of `getKeys` blacklist
brettz9 50ec7e8
refactor: allow for more primitiveish types; fix error
brettz9 48eab7d
refactor: drop optional chaining fix for Node 12
brettz9 0f420df
refactor: update testing/build devDeps.
brettz9 1cf073a
refactor: exclude keys if not leading to an object with a non-comment…
brettz9 90d5ed4
refactor: no need for async on function
brettz9 28a20f6
refactor: Remove commented out properties
brettz9 5e36dd6
refactor: Avoid unnecessary await
brettz9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these lines? We usually avoid having commented-out code in the codebase unless it is associated with a TODO action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I had thought these were going to be removed in a future version, so should I add a comment to do so? File an issue? Is there any particular approach for planning ahead with to-dos to occur before breaking changes?
eslint-plugin-unicorn
has a truly excellentexpiring-todo-comments
rule which can be tied to version or dependency changes which will cause linting to fail unless applied. I might recommend unicorn foreslint-config-eslint
anyways.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be best to discuss this in an issue first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using GitHub issues to track planned features and bug fixes. We are rarely using TODO comments, mostly for code parts that we think should be refactored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for the feedback. Added #38 and removed the comments.
And FWIW, re: Unicorn, I filed eslint/eslint#15731 . Even when not heavily using to-dos in code, having those conditional to-dos can really help ensure that version-dependent to-dos don't get lost.