@fabriziosalmi/slopless 1.12.1 → 1.12.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/dist/engine/api.js +2 -2
- package/dist/index.js +41 -41
- package/package.json +1 -1
- package/rules/VBC-944.yaml +8 -1
package/package.json
CHANGED
package/rules/VBC-944.yaml
CHANGED
|
@@ -10,8 +10,12 @@ match:
|
|
|
10
10
|
# settles it first: `mailto:${addr}` and `/blog/${slug}` cannot become
|
|
11
11
|
# `javascript:` whatever the value is, and that is how a template builds
|
|
12
12
|
# every ordinary link.
|
|
13
|
+
#
|
|
14
|
+
# import.meta.env.X is replaced by the bundler before the page ever runs, so
|
|
15
|
+
# it is a literal by the time a request exists. Vite and Astro spell every
|
|
16
|
+
# base path that way.
|
|
13
17
|
regex: >-
|
|
14
|
-
href\s*=\s*\{[^}]*\+|href\s*=\s*[`'"]\s*\$\{|href\s*=\s*\{\s*[`'"]\s*\$\{
|
|
18
|
+
href\s*=\s*\{[^}]*\+|href\s*=\s*[`'"]\s*\$\{(?!\s*import\.meta\.env\.)|href\s*=\s*\{\s*[`'"]\s*\$\{(?!\s*import\.meta\.env\.)
|
|
15
19
|
scan: all
|
|
16
20
|
file_types:
|
|
17
21
|
- js
|
|
@@ -32,4 +36,7 @@ tests:
|
|
|
32
36
|
- '<a href={`mailto:${contact.email}`}>write to us</a>'
|
|
33
37
|
- '<a href={`/blog/${slug}`}>read on</a>'
|
|
34
38
|
- '<a href={`https://example.org/u/${user}`}>profile</a>'
|
|
39
|
+
# Replaced by the bundler before a request exists.
|
|
40
|
+
- '<link href={`${import.meta.env.BASE_URL}favicon.svg`} />'
|
|
41
|
+
- '<a href={`${import.meta.env.BASE_URL}docs/${slug}`}>docs</a>'
|
|
35
42
|
- <a href="/static/page">page</a>
|