PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: effekt-lang/effekt (scala)

Issue:
Parse '\'' correctly
Currently `'\''` doesn't ~~parse~~ _lex_, but it really should :)
See details below.

cc @b-studios

Pull request:
Fixes #724.

Patch:
diff --git a/effekt/shared/src/main/scala/effekt/Lexer.scala b/effekt/shared/src/main/scala/effekt/Lexer.scala
index 32049d7c1..53f52c991 100644
--- a/effekt/shared/src/main/scala/effekt/Lexer.scala
+++ b/effekt/shared/src/main/scala/effekt/Lexer.scala
@@ -434,6 +434,7 @@ class Lexer(source: Source) {
           expect('\\')
           peek() match {
             case Some('"') => consume(); stringContent.addOne('"')
+            case Some('\'') => consume(); stringContent.addOne('\'')
             case Some('n') => consume(); stringContent.addOne('\n')
             case Some('t') => consume(); stringContent.addOne('\t')
             case Some('r') => consume(); stringContent.addOne('\r')


Test patch:
diff --git a/effekt/jvm/src/test/scala/effekt/LexerTests.scala b/effekt/jvm/src/test/scala/effekt/LexerTests.scala
index 53f013dae..f1049c3da 100644
--- a/effekt/jvm/src/test/scala/effekt/LexerTests.scala
+++ b/effekt/jvm/src/test/scala/effekt/LexerTests.scala
@@ -98,6 +98,10 @@ class LexerTests extends munit.FunSuite {
     assertFailure("\"\\k\"")
     assertTokensEq("\"\\u001b\"", Str("\u001b", false), EOF)
     assertTokensEq("\"\\u{001b}\"", Str("\u001b", false), EOF)
+    assertTokensEq("'\\\''", Chr(39), EOF)
+    assertTokensEq("\"'\"", Str("'", false), EOF)
+    assertTokensEq("'\\\"'", Chr(34), EOF)
+    assertTokensEq("\"\\\"\"", Str("\"", false), EOF)
   }
 
   test("characters") {
Repository: edvardchen/eslint-plugin-i18next (js)

Issue:
Avoid detecting text of type union.
We would like to prevent Lint from detecting values with the union type specified, as shown below.
Currently, it is detected as an error.

```ts
type Animal = 'dog' | 'cat'

const animal: Animal = 'dog' -> disallow literal string: sample: Animal = 'dog'eslint(i18next/no-literal-string)
```

---

This PR https://github.com/edvardchen/eslint-plugin-i18next/pull/56 has been deleted in what appears to be the relevant code. Do you plan to implement similar changes again?

Pull request:
feat: ignore hand-written literal type
Fixes #114 

Patch:
diff --git a/lib/rules/no-literal-string.js b/lib/rules/no-literal-string.js
index 057dd24..3565176 100644
--- a/lib/rules/no-literal-string.js
+++ b/lib/rules/no-literal-string.js
@@ -89,10 +89,39 @@ module.exports = {
       });
     }
 
+    const { esTreeNodeToTSNodeMap, program } = parserServices;
+    let typeChecker;
+    if (program && esTreeNodeToTSNodeMap)
+      typeChecker = program.getTypeChecker();
+
     function validateBeforeReport(node) {
       if (isValidScope()) return;
       if (isValidLiteral(options, node)) return;
 
+      // ─── Typescript ──────────────────────────────────────
+
+      if (typeChecker) {
+        const tsNode = esTreeNodeToTSNodeMap.get(node);
+        const typeObj = typeChecker.getContextualType(tsNode);
+        if (typeObj) {
+          // var a: 'abc' = 'abc'
+          if (typeObj.isStringLiteral()) {
+            return;
+          }
+
+          // var a: 'abc' | 'name' = 'abc'
+          if (typeObj.isUnion()) {
+            const found = typeObj.types.some(item => {
+              if (item.isStringLiteral() && item.value === node.value) {
+                return true;
+              }
+            });
+            if (found) return;
+          }
+        }
+      }
+      // ─────────────────────────────────────────────────────
+
       report(node);
     }
 


Test patch:
diff --git a/tests/lib/fixtures/valid-typescript.ts b/tests/lib/fixtures/valid-typescript.ts
index 552d691..4821c3b 100644
--- a/tests/lib/fixtures/valid-typescript.ts
+++ b/tests/lib/fixtures/valid-typescript.ts
@@ -18,4 +18,11 @@ var a6 = T2['howard'];
 function Button2({ t = 'name' }: { t: 'name' }) {}
 
 type Ta = { t?: 'name' | 'abc' };
+let ta: Ta = { t: 'abc' };
+
+const str: 'str' = 'str';
+
+type Animal = 'dog' | 'cat';
+const animal: Animal = 'dog';
+
 function Button3({ t = 'name' }: Ta) {}