@mehshekari/eslint-plugin-gsap-motion 4.6.0 → 4.6.1
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/rules.mjs +5 -1
- package/lib/source.mjs +8 -1
- package/package.json +1 -1
package/lib/rules.mjs
CHANGED
|
@@ -1895,7 +1895,11 @@ export const RULES = [
|
|
|
1895
1895
|
* returned early under reduced motion. Only the full audit knows the
|
|
1896
1896
|
* importers; the editor and the write hook see one file, and report it.
|
|
1897
1897
|
*/
|
|
1898
|
-
if (
|
|
1898
|
+
if (
|
|
1899
|
+
file.importers?.length &&
|
|
1900
|
+
!file.importersUnknown &&
|
|
1901
|
+
file.importers.every((importer) => !importer.parseError && hasReducedBranch(importer))
|
|
1902
|
+
) {
|
|
1899
1903
|
return [];
|
|
1900
1904
|
}
|
|
1901
1905
|
|
package/lib/source.mjs
CHANGED
|
@@ -249,7 +249,14 @@ export function fromText(raw, path, display = path) {
|
|
|
249
249
|
*/
|
|
250
250
|
usesGsap:
|
|
251
251
|
/\bfrom ["']gsap(?:\/|["'])/.test(code) ||
|
|
252
|
-
/\bimport\s+(?!type\b)(?:gsap\b|\{[^}]*\bgsap\b[^}]*\})[^;]*?\bfrom\s*["']/.test(code)
|
|
252
|
+
/\bimport\s+(?!type\b)(?:gsap\b|\{[^}]*\bgsap\b[^}]*\})[^;]*?\bfrom\s*["']/.test(code) ||
|
|
253
|
+
/**
|
|
254
|
+
* Loaded on demand: `loadGsap().then(({ gsap }) => …)` or
|
|
255
|
+
* `const { gsap } = await import(…)`. A real project's brand loader did
|
|
256
|
+
* this, and was the one file in eleven the lifecycle rules skipped.
|
|
257
|
+
*/
|
|
258
|
+
/\(\s*\{[^}]*\bgsap\b[^}]*\}\s*\)\s*=>/.test(code) ||
|
|
259
|
+
/\{[^}]*\bgsap\b[^}]*\}\s*=\s*await\s+import\s*\(/.test(code),
|
|
253
260
|
};
|
|
254
261
|
}
|
|
255
262
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mehshekari/eslint-plugin-gsap-motion",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"description": "The gsap-motion audit as ESLint rules: GSAP tweens that outlive their component, per-event allocations and missing reduced-motion branches, reported in your editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|