@justeattakeaway/eslint-plugin-snacks-pie-migration 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/util/git-utils.js +5 -5
- package/package.json +8 -8
package/lib/util/git-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { execFileSync } = require('child_process');
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Check if a file was added but not committed yet
|
|
@@ -8,7 +8,7 @@ const { execSync } = require('child_process');
|
|
|
8
8
|
function isFileNew (relativeFilePath) {
|
|
9
9
|
try {
|
|
10
10
|
// File exists in HEAD
|
|
11
|
-
|
|
11
|
+
execFileSync('git', ['cat-file', '-e', `HEAD:${relativeFilePath}`], { stdio: 'ignore' });
|
|
12
12
|
return false;
|
|
13
13
|
} catch {
|
|
14
14
|
return true;
|
|
@@ -25,8 +25,8 @@ function isFileNew (relativeFilePath) {
|
|
|
25
25
|
function getFileStateFromRef (relativeFilePath, ref, branch = 'main') {
|
|
26
26
|
try {
|
|
27
27
|
// If the base sha wasn't provided, try to guess with merge-base
|
|
28
|
-
const sha = ref ||
|
|
29
|
-
return
|
|
28
|
+
const sha = ref || execFileSync('git', ['merge-base', 'HEAD', branch], { encoding: 'utf8' }).trim();
|
|
29
|
+
return execFileSync('git', ['show', `${sha}:${relativeFilePath}`], { encoding: 'utf8', stdio: 'pipe' });
|
|
30
30
|
} catch {
|
|
31
31
|
// If the file was added in this branch, this might fail, return empty string
|
|
32
32
|
return '';
|
|
@@ -39,7 +39,7 @@ function getFileStateFromRef (relativeFilePath, ref, branch = 'main') {
|
|
|
39
39
|
*/
|
|
40
40
|
function getDefaultBranchName () {
|
|
41
41
|
try {
|
|
42
|
-
|
|
42
|
+
execFileSync('git', ['show-ref', '--verify', '--quiet', 'refs/heads/main'], { stdio: 'ignore' });
|
|
43
43
|
return 'main';
|
|
44
44
|
} catch {
|
|
45
45
|
return 'master';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/eslint-plugin-snacks-pie-migration",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "This plugin helps developers to identify deprecated Snacks components and provides suggestions of replacement PIE components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"author": "Just Eat Takeaway.com - Design System Team",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "yarn extract-component-data",
|
|
14
|
-
"test": "run -T vitest",
|
|
14
|
+
"test": "run -T vitest run",
|
|
15
|
+
"test:watch": "run -T vitest",
|
|
15
16
|
"lint:scripts": "run -T eslint .",
|
|
16
17
|
"lint:scripts:fix": "run -T eslint . --fix",
|
|
17
18
|
"extract-component-data": "node scripts/extract-component-data.js"
|
|
@@ -34,11 +35,13 @@
|
|
|
34
35
|
"snacks-components-data.json",
|
|
35
36
|
"snacks-components-solutions.js"
|
|
36
37
|
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"glob": "13.0.6"
|
|
40
|
+
},
|
|
37
41
|
"devDependencies": {
|
|
38
42
|
"@typescript-eslint/parser": "8.46.3",
|
|
39
43
|
"eslint": "8.57.0",
|
|
40
|
-
"eslint-plugin-eslint-plugin": "6.0.0"
|
|
41
|
-
"glob": "11.1.0"
|
|
44
|
+
"eslint-plugin-eslint-plugin": "6.0.0"
|
|
42
45
|
},
|
|
43
46
|
"engines": {
|
|
44
47
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
@@ -47,8 +50,5 @@
|
|
|
47
50
|
"@typescript-eslint/parser": "8.46.3",
|
|
48
51
|
"eslint": ">=7.32.0"
|
|
49
52
|
},
|
|
50
|
-
"license": "Apache-2.0"
|
|
51
|
-
"volta": {
|
|
52
|
-
"extends": "../../../package.json"
|
|
53
|
-
}
|
|
53
|
+
"license": "Apache-2.0"
|
|
54
54
|
}
|