eslint-plugin-chrome-extensions 2.11.0 → 2.11.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/README.md +2 -2
- package/package.json +15 -3
- package/src/utils/pkg.js +14 -16
- package/src/utils/text.js +3 -0
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ npm i -D eslint-plugin-chrome-extensions
|
|
|
33
33
|
Usage
|
|
34
34
|
</h2>
|
|
35
35
|
|
|
36
|
-
### <img
|
|
36
|
+
### <img width=15 src="https://www.google.com/s2/favicons?domain=eslint.org&sz=64"> ESLint
|
|
37
37
|
|
|
38
38
|
Add bundled configs to your `eslint.config.*js` for each file type you need:
|
|
39
39
|
|
|
@@ -65,7 +65,7 @@ export default [
|
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
-
### <img
|
|
68
|
+
### <img width=15 src="https://www.google.com/s2/favicons?domain=oxc.rs&sz=64"> Oxlint
|
|
69
69
|
|
|
70
70
|
Add a JS/TS bundle to your `oxlint.config.*ts` (non-JS/TS parsing is unsupported by Oxlint):
|
|
71
71
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-chrome-extensions",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.2",
|
|
4
4
|
"description": "ESLint rules for Chrome extensions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -60,6 +60,17 @@
|
|
|
60
60
|
"lint:all": "pre-commit run --all-files",
|
|
61
61
|
"test": "node tests/run"
|
|
62
62
|
},
|
|
63
|
+
"overrides": {
|
|
64
|
+
"@eslint/config-array": {
|
|
65
|
+
"minimatch": "^11.0.5"
|
|
66
|
+
},
|
|
67
|
+
"@typescript-eslint/typescript-estree": {
|
|
68
|
+
"minimatch": "^11.0.5"
|
|
69
|
+
},
|
|
70
|
+
"eslint-plugin-sonarjs": {
|
|
71
|
+
"minimatch": "^11.0.5"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
63
74
|
"dependencies": {
|
|
64
75
|
"globals": "^17.14.0",
|
|
65
76
|
"spdx-license-ids": "^3.0.24",
|
|
@@ -73,10 +84,11 @@
|
|
|
73
84
|
"@html-eslint/eslint-plugin": "^0.67.0",
|
|
74
85
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
75
86
|
"@typescript-eslint/parser": "^8.72.1",
|
|
87
|
+
"@typescript-eslint/utils": "^8.72.1",
|
|
76
88
|
"eslint": "^10.14.0",
|
|
77
|
-
"eslint-plugin-constructors": "^1.7.
|
|
89
|
+
"eslint-plugin-constructors": "^1.7.1",
|
|
78
90
|
"eslint-plugin-eslint-plugin": "^7.6.2",
|
|
79
|
-
"eslint-plugin-import-x": "^4.
|
|
91
|
+
"eslint-plugin-import-x": "^4.18.0",
|
|
80
92
|
"eslint-plugin-n": "^18.5.0",
|
|
81
93
|
"eslint-plugin-no-secrets": "^2.3.3",
|
|
82
94
|
"eslint-plugin-no-unsanitized": "^4.1.5",
|
package/src/utils/pkg.js
CHANGED
|
@@ -2,6 +2,19 @@ import { fileURLToPath } from 'node:url'
|
|
|
2
2
|
import fs from 'node:fs'
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
|
|
5
|
+
const pkg = (() => {
|
|
6
|
+
let current = path.dirname(fileURLToPath(import.meta.url))
|
|
7
|
+
while (current) { // oxlint-disable security/detect-non-literal-fs-filename
|
|
8
|
+
const pkgPath = path.join(current, 'package.json')
|
|
9
|
+
if (fs.existsSync(pkgPath))
|
|
10
|
+
try { return JSON.parse(fs.readFileSync(pkgPath, 'utf8')) } catch {}
|
|
11
|
+
const parent = path.dirname(current)
|
|
12
|
+
if (parent === current) break
|
|
13
|
+
current = parent
|
|
14
|
+
} // oxlint-enable security/detect-non-literal-fs-filename
|
|
15
|
+
return null
|
|
16
|
+
})()
|
|
17
|
+
|
|
5
18
|
export default {
|
|
6
19
|
findRoot(dir) {
|
|
7
20
|
let current = path.resolve(dir)
|
|
@@ -19,20 +32,5 @@ export default {
|
|
|
19
32
|
current = parent
|
|
20
33
|
}
|
|
21
34
|
},
|
|
22
|
-
|
|
23
|
-
getName() { // oxlint-disable security/detect-non-literal-fs-filename
|
|
24
|
-
let current = path.dirname(fileURLToPath(import.meta.url))
|
|
25
|
-
while (current) {
|
|
26
|
-
const pkgPath = path.join(current, 'package.json')
|
|
27
|
-
if (fs.existsSync(pkgPath))
|
|
28
|
-
try {
|
|
29
|
-
const { name } = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))
|
|
30
|
-
if (name) return name
|
|
31
|
-
} catch { /* malformed, keep walking */ }
|
|
32
|
-
const parent = path.dirname(current)
|
|
33
|
-
if (parent === current) return null
|
|
34
|
-
current = parent
|
|
35
|
-
}
|
|
36
|
-
return null
|
|
37
|
-
} // oxlint-enable security/detect-non-literal-fs-filename
|
|
35
|
+
getName() { return pkg?.name ?? null }
|
|
38
36
|
}
|