nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: francoismassart/eslint-plugin-tailwindcss
Pull request #22 (2021-05-28 07:55:01)

Fix error on Align Self (self-end)
# Fix error on Align Self

## Description

Fixes a bug where this plugin treated the tailwind class `self-end` as a custom class.

See: https://tailwindcss.com/docs/align-self

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

**Test Configuration**:
* OS + version: MacOS Big Sur
* NPM version: 6.4.12
* Node version: 14.16.1

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
- [x] I have checked my code and corrected any misspellings



Patch:
diff --git a/lib/config/groups.js b/lib/config/groups.js
index 8268471..18618f9 100644
--- a/lib/config/groups.js
+++ b/lib/config/groups.js
@@ -257,7 +257,7 @@ module.exports.groups = [
       },
       {
         type: 'Align Self',
-        members: 'items\\-(auto|start|end|center|stretch)',
+        members: 'self\\-(auto|start|end|center|stretch)',
       },
       {
         type: 'Place Content',
diff --git a/lib/util/ast.js b/lib/util/ast.js
index 2af45ae..eb1b80e 100644
--- a/lib/util/ast.js
+++ b/lib/util/ast.js
@@ -71,6 +71,9 @@ function parseNodeRecursive(node, arg, cb, skipConditional = false, isolate = fa
       return;
     }
     cb(classNames, node);
+  } else if (arg === undefined) {
+    // Ignore invalid child candidates (probably inside complex TemplateLiteral)
+    return;
   } else {
     const forceIsolation = skipConditional ? true : isolate;
     switch (arg.type) {


Test patch:
diff --git a/tests/lib/rules/no-custom-classname.js b/tests/lib/rules/no-custom-classname.js
index 0fabb56..3ee073d 100644
--- a/tests/lib/rules/no-custom-classname.js
+++ b/tests/lib/rules/no-custom-classname.js
@@ -28,7 +28,7 @@ var ruleTester = new RuleTester({ parserOptions });
 ruleTester.run("no-custom-classname", rule, {
   valid: [
     {
-      code: `<div class="container box-content lg:box-border max-h-24">Only Tailwind CSS classnames</div>`,
+      code: `<div class="container box-content lg:box-border max-h-24 self-end">Only Tailwind CSS classnames</div>`,
     },
     {
       code: `
Repository: francoismassart/eslint-plugin-tailwindcss
Pull request #34 (2021-06-10 17:51:48)

fix: broken regex for extracting classnames


Patch:
diff --git a/lib/util/cssFiles.js b/lib/util/cssFiles.js
index fcc7af6..30607b5 100644
--- a/lib/util/cssFiles.js
+++ b/lib/util/cssFiles.js
@@ -28,7 +28,7 @@ const generateClassnamesListSync = (patterns) => {
       const data = fs.readFileSync(file, 'utf-8');
       const root = postcss.parse(data);
       root.walkRules((rule) => {
-        const regexp = /\.([^\.\,\s\n]*)/gim;
+        const regexp = /\.([^\.\,\s\n\:\)]*)/gim;
         const matches = [...rule.selector.matchAll(regexp)];
         const classnames = matches.map((arr) => arr[1]);
         detectedClassnames.push(...classnames);


Test patch:
diff --git a/tests/lib/rules/another.css b/tests/lib/rules/another.css
index e33bb8e..403f7fe 100644
--- a/tests/lib/rules/another.css
+++ b/tests/lib/rules/another.css
@@ -1,4 +1,37 @@
-/* Only used for running tests */
-.another {
-  display: block;
+/* .custom-carousel li:first-child {
+  padding-left: 20vw;
+} */
+
+:global(.slide:not(.selected)) {
+  opacity: 0.2;
+}
+
+.gallery-snackbar {
+  @apply w-full;
+}
+
+.custom-slide {
+  height: 70vh;
+}
+
+@media (min-width: 768px) {
+  .custom-carousel li:not(:first-child) {
+    @apply pl-16;
+  }
+
+  .custom-carousel li:not(:last-child) {
+    @apply pr-16;
+  }
+
+  .custom-carousel :global(.carousel-root) {
+    padding: 0 calc(10vw + 16px);
+  }
+
+  .gallery-snackbar {
+    width: calc(80vw - 32px);
+  }
+
+  .indicator {
+    margin-left: calc(10vw + 16px);
+  }
 }
Repository: francoismassart/eslint-plugin-tailwindcss
Pull request #86 (2022-01-05 15:37:08)

fix: correctly handle number values in config
Feel free to edit/close/etc.

# Pull Request Name
Correctly handle number values in config.

## Description

Given this Tailwind config:

```ts
module.exports = {
  theme: {
      zIndex: {
        dialog: 10000,
      },
  }
}
```

The lint task fails with

```
TypeError: Error while loading rule 'tailwindcss/no-contradicting-classname': val.indexOf is not a function
```

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

Test is included in the PR

<!--
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

**Test Configuration**:
* OS + version: e.g. macOS Mojave
* NPM version: ...
* Node version: ...

-->

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [-] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
- [x] I have checked my code and corrected any misspellings



Patch:
diff --git a/lib/util/groupMethods.js b/lib/util/groupMethods.js
index babd03c..54a2920 100644
--- a/lib/util/groupMethods.js
+++ b/lib/util/groupMethods.js
@@ -318,7 +318,7 @@ function patchRegex(re, config) {
         if (isNegative) {
           // Negative prop cannot support NaN values and inherits positive values
           const val = config.theme[absoluteProp][key];
-          const isCalc = val.indexOf('calc') === 0;
+          const isCalc = typeof val === 'string' && val.indexOf('calc') === 0;
           const num = parseFloat(val);
           if (isCalc) {
             return true;


Test patch:
diff --git a/tests/lib/rules/classnames-order.js b/tests/lib/rules/classnames-order.js
index d3e667b..46f105e 100644
--- a/tests/lib/rules/classnames-order.js
+++ b/tests/lib/rules/classnames-order.js
@@ -162,6 +162,14 @@ ruleTester.run("classnames-order", rule, {
         },
       ],
     },
+    {
+      code: `<div class="flex z-dialog w-12">Number values</div>`,
+      settings: {
+        tailwindcss: {
+          config: { theme: { zIndex: { dialog: 10000 } } },
+        },
+      },
+    },
   ],
   invalid: [
     {
Repository: fraserxu/electron-pdf
Pull request #238 (2019-03-12 14:11:46)

Always use a session partition since adding support for API tokens #236

mattsgarlata: +1

Patch:
diff --git a/lib/exportJob.js b/lib/exportJob.js
index 39b264d..4a7d8fb 100644
--- a/lib/exportJob.js
+++ b/lib/exportJob.js
@@ -359,9 +359,7 @@ class ExportJob extends EventEmitter {
     // default session is used from the main process which would break support
     // for concurrency
     // see http://electron.atom.io/docs/api/browser-window/#new-browserwindowoptions options.partition
-    if (args.cookies) {
-      defaultOpts.webPreferences.partition = this.jobId
-    }
+    defaultOpts.webPreferences.partition = this.jobId
 
     let cmdLineBrowserConfig = {}
     try {
diff --git a/package.json b/package.json
index c12f0fb..89f36de 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "electron-pdf",
-  "version": "4.0.2",
+  "version": "4.0.3",
   "description": "A command line tool to generate PDF from URL, HTML or Markdown files",
   "main": "lib/index.js",
   "scripts": {


Test patch:
diff --git a/test/exportJob-test.js b/test/exportJob-test.js
index 22af9f2..8af47d0 100644
--- a/test/exportJob-test.js
+++ b/test/exportJob-test.js
@@ -57,9 +57,10 @@ test('getBrowserConfiguration_sessionPartitionForCookies', t => {
   t.true(validator.isUUID(partition), 'partition should be a UUID')
 })
 
-test('getBrowserConfiguration_noSessionPartitionUnlessCookies', t => {
+test('getBrowserConfiguration_SessionPartitionWithoutCookies', t => {
   const config = job._getBrowserConfiguration(options)
-  t.falsy(config.webPreferences.partition)
+  const partition = config.webPreferences.partition
+  t.true(validator.isUUID(partition), 'partition should be a UUID')
 })
 
 // File Generation
Repository: Automattic/juice
Pull request #309 (2018-08-27 16:47:04)

Decode entities in XML mode


Patch:
diff --git a/lib/cheerio.js b/lib/cheerio.js
index bc62db2..afc5efd 100644
--- a/lib/cheerio.js
+++ b/lib/cheerio.js
@@ -61,7 +61,7 @@ module.exports = function(html, options, callback, callbackExtraArguments) {
   var doc = callback.apply(undefined, args) || $;
 
   if (options && options.xmlMode) {
-    return doc.xml();
+    return entityConverters.decodeEntities(doc.xml());
   }
   return entityConverters.decodeEntities(doc.html());
 };


Test patch:
diff --git a/test/cases/juice-content/xml.html b/test/cases/juice-content/xml.html
index c0f236c..47a0b26 100644
--- a/test/cases/juice-content/xml.html
+++ b/test/cases/juice-content/xml.html
@@ -5,5 +5,6 @@
 <body>
     hello<br />
     <img src="" />
+    <a href="foo.com?email={{email}}">test</a>
 </body>
 </html>
diff --git a/test/cases/juice-content/xml.out b/test/cases/juice-content/xml.out
index ae08613..c9674f0 100644
--- a/test/cases/juice-content/xml.out
+++ b/test/cases/juice-content/xml.out
@@ -5,5 +5,6 @@
 <body>
     hello<br/>
     <img src=""/>
+    <a href="foo.com?email={{email}}">test</a>
 </body>
 </html>
Repository: Automattic/juice
Pull request #363 (2020-07-01 20:21:13)

Drop unused cssmin and uglify options from cli
I do not see these options are implemented in web-resource-inliner
or juice.


Patch:
diff --git a/juice.d.ts b/juice.d.ts
index e90541d..618ef21 100644
--- a/juice.d.ts
+++ b/juice.d.ts
@@ -60,7 +60,6 @@ declare namespace juice {
     links?: boolean | number;
     relativeTo?: string;
     rebaseRelativeTo?: string;
-    cssmin?: boolean;
     strict?: boolean;
   }
 }
diff --git a/lib/cli.js b/lib/cli.js
index 384b5dc..33f9e4a 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -109,16 +109,6 @@ cli.options = {
     pMap: 'webResourcesRebaseRelativeTo',
     map: 'rebaseRelativeTo',
     def: 'see docs for web-resource-inliner rebaseRelativeTo' },
-  'web-resources-cssmin': {
-    pMap: 'webResourcesCssmin',
-    map: 'cssmin',
-    def: 'see docs for web-resource-inliner cssmin',
-    coercion: JSON.parse },
-  'web-resources-uglify': {
-    pMap: 'webResourcesUglify',
-    map: 'uglify',
-    def: 'see docs for web-resource-inliner uglify',
-    coercion: JSON.parse },
   'web-resources-strict': {
     pMap: 'webResourcesStrict',
     map: 'strict',


Test patch:
diff --git a/test/cli.js b/test/cli.js
index d885c8d..2b7bbfd 100644
--- a/test/cli.js
+++ b/test/cli.js
@@ -32,8 +32,6 @@ it('cli parses options', function(done) {
   assert.strictEqual(cli.argsToOptions({'webResourcesScripts': '24'}).webResources.scripts, 24);
   assert.strictEqual(cli.argsToOptions({'webResourcesRelativeTo': 'web'}).webResources.relativeTo, 'web');
   assert.strictEqual(cli.argsToOptions({'webResourcesRebaseRelativeTo': 'root'}).webResources.rebaseRelativeTo, 'root');
-  assert.strictEqual(cli.argsToOptions({'webResourcesCssmin': 'true'}).webResources.cssmin, true);
-  assert.strictEqual(cli.argsToOptions({'webResourcesUglify': 'true'}).webResources.uglify, true);
   assert.strictEqual(cli.argsToOptions({'webResourcesStrict': 'true'}).webResources.strict, true);
   done();
 });
@@ -111,4 +109,4 @@ it('cli supports codeBlock', function(done) {
     assert.equal(output, expectedOutput);
     done();
   });
-});
\ No newline at end of file
+});
diff --git a/test/typescript/juice-tests.ts b/test/typescript/juice-tests.ts
index 13b6e85..17f7c2d 100644
--- a/test/typescript/juice-tests.ts
+++ b/test/typescript/juice-tests.ts
@@ -42,7 +42,6 @@ const allWebResourceOptions = {
     links: true,
     relativeTo: 'https://github.com/',
     rebaseRelativeTo: 'assets',
-    cssmin: true,
     strict: true,
   },
 };