-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(schematics): cleanup attribute selector rules #12507
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(schematics): cleanup attribute selector rules #12507
Conversation
0b34535
to
7ba1c5a
Compare
import * as ts from 'typescript'; | ||
|
||
/** | ||
* Rule that walks through every string literal that i |
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.
Truncated description?
@@ -0,0 +1,54 @@ | |||
/** |
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.
Probably in another PR, but we should also make these filenames consistent with the rest of the project (dashes instead of camelCase)
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.
That does unfortunately not work because TSLint expects the files to the be camel-cased in order to load them.
/** Method that can be used to replace all search occurrences in a string. */ | ||
export function findAll(str: string, search: string): number[] { | ||
/** Finds all occurrences of the given search string in an input string and returns the offsets. */ | ||
export function findAllSearchOccurrences(input: string, search: string): number[] { |
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 would call this findAllSubstringIndices
7ba1c5a
to
f484081
Compare
@jelbourn Addressed your feedback. Please have another look. |
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.
LGTM
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
* Cleans up the `attribute-selector` rules by avoiding duplicate code and making the code generally more readable. Also moves all rules tied to the `attributeSelectors` data into a sub directory. * Renames the `findAll` method to `findAllSubstringIndices` because just having `findAll` is very ambiguous. * Removes the unused `extra-stylesheets` file.
f484081
to
e82d3a3
Compare
@josephperrott Rebased. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Cleans up the
attribute-selector
rules by avoiding duplicate code, too much indentation and nesting. Also moves all rules tied to theattributeSelectors
data into a sub directory.Renames the
findAll
method tofindAllSubstringIndices
because just havingfindAll
is very ambiguous.Removes the unused
extra-stylesheets
file.Note: Ignore the changes related to the
findAllSubstringIndices
in the other rules. Those will be cleaned-up and moved into a subdirectory in follow-up PRs. This also makes it easier to differentiate betweenv6
andv7
data at some point.