Skip to content
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

Ban index methods on std::str::Chars #6071

Closed
Boshen opened this issue Sep 26, 2024 · 1 comment · Fixed by #6075
Closed

Ban index methods on std::str::Chars #6071

Boshen opened this issue Sep 26, 2024 · 1 comment · Fixed by #6075
Assignees
Labels
A-linter Area - Linter C-enhancement Category - New feature or request good first issue Experience Level - Good for newcomers

Comments

@Boshen
Copy link
Member

Boshen commented Sep 26, 2024

Background:

A quick grep:

crates/oxc_linter/src/rules/nextjs/no_typos.rs|136 col 22| for (i, s1) in a.chars().enumerate() {
crates/oxc_linter/src/rules/nextjs/no_typos.rs|138 col 26| for (j, s2) in b.chars().enumerate() {
crates/oxc_codegen/src/lib.rs|318 col 63| unsafe { std::str::from_utf8_unchecked(self.code()) }.chars().nth_back(n)
crates/oxc_linter/src/partial_loader/astro.rs|75 col 49| if let Some('/') = self.source_text.chars().nth(js_start - 2) {
crates/oxc_linter/src/rules/eslint/no_useless_escape.rs|199 col 33| let escape_char = char_text.chars().nth(1).unwrap();
crates/oxc_linter/src/rules/eslint/no_useless_escape.rs|227 col 60| if let Some(prev_char) = ctx.source_text().chars().nth(span.end as usize) {
crates/oxc_linter/src/rules/eslint/no_useless_escape.rs|233 col 65| if let Some(prev_prev_char) = ctx.source_text().chars().nth(span.start as usize - 1)
crates/oxc_linter/src/rules/eslint/no_useless_escape.rs|290 col 28| if let Some(c) = s.chars().nth(1) {
crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs|239 col 19| let c = s.chars().nth(i).unwrap();
crates/oxc_linter/src/utils/react.rs|256 col 37| name.starts_with("use") && name.chars().nth(3).map_or(true, char::is_uppercase)
crates/oxc_linter/src/utils/react.rs|259 col 40| // name.starts_with("use") && name.chars().nth(3).is_some_and(char::is_uppercase)
crates/oxc_minifier/src/node_util/mod.rs|393 col 38| let radix: u32 = match s.chars().nth(1) {
crates/oxc_prettier/src/format/mod.rs|84 col 66| if let Some(c) = p.source_text[self.span.end as usize..].chars().nth(1) {
crates/oxc_sourcemap/src/sourcemap_visualizer.rs|144 col 46| if ch == '\r' && content.chars().nth(i + 1) == Some('\n') {
@Boshen Boshen added C-enhancement Category - New feature or request good first issue Experience Level - Good for newcomers A-linter Area - Linter labels Sep 26, 2024
@Boshen
Copy link
Member Author

Boshen commented Sep 26, 2024

@Boshen Boshen self-assigned this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request good first issue Experience Level - Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant