@automattic/eslint-plugin-wpvip 0.4.12 → 0.4.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/eslint-plugin-wpvip",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "description": "ESLint plugin for internal WordPress VIP projects",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,28 +1,8 @@
1
- const fs = require('node:fs');
2
1
  const debugLog = require('./debug-log');
3
2
  const findPackageJson = require('find-package-json');
4
3
 
5
- function findParent() {
6
- const packages = [...findPackageJson()];
7
- const firstPackage = packages.shift();
8
-
9
- // A little hack to help us use this plugin to lint itself: When installed via
10
- // NPM, .eslintrc.js will be missing (due to .npmignore).
11
- if ('@automattic/eslint-plugin-wpvip' === firstPackage.name) {
12
- const eslintRc = firstPackage.__path.replace(
13
- /package\.json$/,
14
- '.eslintrc.js'
15
- );
16
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17
- if (fs.statSync(eslintRc)) {
18
- return firstPackage;
19
- }
20
- }
21
-
22
- return packages.pop() || {};
23
- }
24
-
25
- const parent = findParent();
4
+ const packages = [...findPackageJson(__dirname)];
5
+ const parent = packages.pop() || {};
26
6
 
27
7
  debugLog(`Found package.json: ${parent.__path || 'none'}`);
28
8