diff --git a/apps/oxlint/test/fixtures/fixes/files/bom_and_unicode.js b/apps/oxlint/test/fixtures/fixes/files/bom_and_unicode.js new file mode 100644 index 0000000000000..ee6083d7c1710 --- /dev/null +++ b/apps/oxlint/test/fixtures/fixes/files/bom_and_unicode.js @@ -0,0 +1,3 @@ +a = c; +// 😀🤪😆😎🤮 +g = b \ No newline at end of file diff --git a/apps/oxlint/test/fixtures/fixes/files/unicode.js b/apps/oxlint/test/fixtures/fixes/files/unicode.js new file mode 100644 index 0000000000000..0b705f2faecc0 --- /dev/null +++ b/apps/oxlint/test/fixtures/fixes/files/unicode.js @@ -0,0 +1,3 @@ +a = c; +// 😀🤪😆😎🤮 +g = b \ No newline at end of file diff --git a/apps/oxlint/test/fixtures/fixes/fix.snap.md b/apps/oxlint/test/fixtures/fixes/fix.snap.md index 6c6a664490b0d..68cb672c92055 100644 --- a/apps/oxlint/test/fixtures/fixes/fix.snap.md +++ b/apps/oxlint/test/fixtures/fixes/fix.snap.md @@ -4,7 +4,7 @@ # stdout ``` Found 0 warnings and 0 errors. -Finished in Xms on 2 files with 1 rules using X threads. +Finished in Xms on 4 files with 1 rules using X threads. ``` # stderr @@ -17,6 +17,13 @@ Finished in Xms on 2 files with 1 rules using X threads. rage = abacus ``` +# File altered: files/bom_and_unicode.js +``` +daddy = magic; +// 😀🤪😆😎🤮 +rage = abacus +``` + # File altered: files/index.js ``` @@ -34,3 +41,10 @@ let cowabunga = 10; ``` + +# File altered: files/unicode.js +``` +daddy = magic; +// 😀🤪😆😎🤮 +rage = abacus +``` diff --git a/apps/oxlint/test/fixtures/fixes/output.snap.md b/apps/oxlint/test/fixtures/fixes/output.snap.md index ee79d0e199f04..eb6b0566e9be8 100644 --- a/apps/oxlint/test/fixtures/fixes/output.snap.md +++ b/apps/oxlint/test/fixtures/fixes/output.snap.md @@ -31,6 +31,34 @@ : ^ `---- + x fixes-plugin(fixes): Replace "a" with "daddy" + ,-[files/bom_and_unicode.js:1:4] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x fixes-plugin(fixes): Prefix "c" with "magi" + ,-[files/bom_and_unicode.js:1:8] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x fixes-plugin(fixes): Replace "g" with "rage" + ,-[files/bom_and_unicode.js:3:1] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + + x fixes-plugin(fixes): Replace "b" with "abacus" + ,-[files/bom_and_unicode.js:3:5] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + x fixes-plugin(fixes): Remove debugger statement ,-[files/index.js:1:1] 1 | debugger; @@ -125,8 +153,36 @@ : ^^^^^^^^^ `---- -Found 0 warnings and 16 errors. -Finished in Xms on 2 files with 1 rules using X threads. + x fixes-plugin(fixes): Replace "a" with "daddy" + ,-[files/unicode.js:1:1] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x fixes-plugin(fixes): Prefix "c" with "magi" + ,-[files/unicode.js:1:5] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x fixes-plugin(fixes): Replace "g" with "rage" + ,-[files/unicode.js:3:1] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + + x fixes-plugin(fixes): Replace "b" with "abacus" + ,-[files/unicode.js:3:5] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + +Found 0 warnings and 24 errors. +Finished in Xms on 4 files with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/suggestions/files/bom_and_unicode.js b/apps/oxlint/test/fixtures/suggestions/files/bom_and_unicode.js new file mode 100644 index 0000000000000..ee6083d7c1710 --- /dev/null +++ b/apps/oxlint/test/fixtures/suggestions/files/bom_and_unicode.js @@ -0,0 +1,3 @@ +a = c; +// 😀🤪😆😎🤮 +g = b \ No newline at end of file diff --git a/apps/oxlint/test/fixtures/suggestions/files/unicode.js b/apps/oxlint/test/fixtures/suggestions/files/unicode.js new file mode 100644 index 0000000000000..0b705f2faecc0 --- /dev/null +++ b/apps/oxlint/test/fixtures/suggestions/files/unicode.js @@ -0,0 +1,3 @@ +a = c; +// 😀🤪😆😎🤮 +g = b \ No newline at end of file diff --git a/apps/oxlint/test/fixtures/suggestions/fix-suggestions.snap.md b/apps/oxlint/test/fixtures/suggestions/fix-suggestions.snap.md index 4ad2e1f0810ae..6e1abcbe22500 100644 --- a/apps/oxlint/test/fixtures/suggestions/fix-suggestions.snap.md +++ b/apps/oxlint/test/fixtures/suggestions/fix-suggestions.snap.md @@ -4,7 +4,7 @@ # stdout ``` Found 0 warnings and 0 errors. -Finished in Xms on 2 files with 1 rules using X threads. +Finished in Xms on 4 files with 1 rules using X threads. ``` # stderr @@ -17,6 +17,13 @@ Finished in Xms on 2 files with 1 rules using X threads. rage = abacus ``` +# File altered: files/bom_and_unicode.js +``` +daddy = magic; +// 😀🤪😆😎🤮 +rage = abacus +``` + # File altered: files/index.js ``` @@ -35,3 +42,10 @@ let kaboom = 11; ``` + +# File altered: files/unicode.js +``` +daddy = magic; +// 😀🤪😆😎🤮 +rage = abacus +``` diff --git a/apps/oxlint/test/fixtures/suggestions/fix.snap.md b/apps/oxlint/test/fixtures/suggestions/fix.snap.md index 0f96f709778f3..553b54d3b7a1f 100644 --- a/apps/oxlint/test/fixtures/suggestions/fix.snap.md +++ b/apps/oxlint/test/fixtures/suggestions/fix.snap.md @@ -31,6 +31,34 @@ : ^ `---- + x suggestions-plugin(suggestions): Replace "a" with "daddy" + ,-[files/bom_and_unicode.js:1:4] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Prefix "c" with "magi" + ,-[files/bom_and_unicode.js:1:8] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Replace "g" with "rage" + ,-[files/bom_and_unicode.js:3:1] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + + x suggestions-plugin(suggestions): Replace "b" with "abacus" + ,-[files/bom_and_unicode.js:3:5] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + x suggestions-plugin(suggestions): Remove debugger statement ,-[files/index.js:1:1] 1 | debugger; @@ -133,8 +161,36 @@ : ^^^^^^^^^ `---- -Found 0 warnings and 17 errors. -Finished in Xms on 2 files with 1 rules using X threads. + x suggestions-plugin(suggestions): Replace "a" with "daddy" + ,-[files/unicode.js:1:1] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Prefix "c" with "magi" + ,-[files/unicode.js:1:5] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Replace "g" with "rage" + ,-[files/unicode.js:3:1] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + + x suggestions-plugin(suggestions): Replace "b" with "abacus" + ,-[files/unicode.js:3:5] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + +Found 0 warnings and 25 errors. +Finished in Xms on 4 files with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/suggestions/output.snap.md b/apps/oxlint/test/fixtures/suggestions/output.snap.md index 0f96f709778f3..553b54d3b7a1f 100644 --- a/apps/oxlint/test/fixtures/suggestions/output.snap.md +++ b/apps/oxlint/test/fixtures/suggestions/output.snap.md @@ -31,6 +31,34 @@ : ^ `---- + x suggestions-plugin(suggestions): Replace "a" with "daddy" + ,-[files/bom_and_unicode.js:1:4] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Prefix "c" with "magi" + ,-[files/bom_and_unicode.js:1:8] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Replace "g" with "rage" + ,-[files/bom_and_unicode.js:3:1] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + + x suggestions-plugin(suggestions): Replace "b" with "abacus" + ,-[files/bom_and_unicode.js:3:5] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + x suggestions-plugin(suggestions): Remove debugger statement ,-[files/index.js:1:1] 1 | debugger; @@ -133,8 +161,36 @@ : ^^^^^^^^^ `---- -Found 0 warnings and 17 errors. -Finished in Xms on 2 files with 1 rules using X threads. + x suggestions-plugin(suggestions): Replace "a" with "daddy" + ,-[files/unicode.js:1:1] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Prefix "c" with "magi" + ,-[files/unicode.js:1:5] + 1 | a = c; + : ^ + 2 | // 😀🤪😆😎🤮 + `---- + + x suggestions-plugin(suggestions): Replace "g" with "rage" + ,-[files/unicode.js:3:1] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + + x suggestions-plugin(suggestions): Replace "b" with "abacus" + ,-[files/unicode.js:3:5] + 2 | // 😀🤪😆😎🤮 + 3 | g = b + : ^ + `---- + +Found 0 warnings and 25 errors. +Finished in Xms on 4 files with 1 rules using X threads. ``` # stderr