@heyramzi/lint 2.0.0 → 2.2.0
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/bin/heyramzi-comment-length.js +4 -3
- package/bin/heyramzi-file-tokens.js +2 -2
- package/bin/heyramzi-slop.js +3 -1
- package/config/oxlintrc.json +1 -1
- package/data/slop/artifacts.js +87 -0
- package/data/slop/pattern-parts.js +56 -0
- package/data/slop/patterns/appositives-and-sayings.js +81 -0
- package/data/slop/patterns/comma-clauses.js +106 -0
- package/data/slop/patterns/diagram-and-script-tells.js +71 -0
- package/data/slop/patterns/dropped-elements.js +149 -0
- package/data/slop/patterns/duration-and-openers.js +102 -0
- package/data/slop/patterns/headings-and-laws.js +116 -0
- package/data/slop/patterns/numbers-and-runs.js +94 -0
- package/data/slop/patterns/openers-and-tails.js +90 -0
- package/data/slop/patterns/parallel-shapes.js +100 -0
- package/data/slop/patterns/reveals-and-tallies.js +101 -0
- package/data/slop/patterns/setups-and-closers.js +83 -0
- package/data/slop/patterns/subject-voice.js +67 -0
- package/data/slop/patterns/vague-and-flourish.js +102 -0
- package/data/slop/patterns/wikipedia-signs.js +103 -0
- package/data/slop/patterns.js +62 -0
- package/data/slop/phrases-en-closers.js +66 -0
- package/data/slop/phrases-en-core.js +185 -0
- package/data/slop/phrases-en-wikipedia.js +136 -0
- package/data/slop/phrases-fr.js +152 -0
- package/data/slop/shapes-density.js +81 -0
- package/data/slop/shapes-framing.js +101 -0
- package/data/slop/shapes-reveals.js +88 -0
- package/data/slop/title-tells.js +8 -0
- package/data/slop/words-en.js +178 -0
- package/data/slop/words-fr.js +101 -0
- package/data/slop-words.js +18 -2576
- package/data/vendor/heading-words.js +6 -0
- package/inline-path.js +2 -0
- package/old-names-mask.js +7 -0
- package/package.json +3 -3
- package/repo-rules/packages.js +5 -0
- package/repo-rules/workflows.js +8 -1
- package/slop.js +4 -2
- package/ui-rules.js +4 -2
package/inline-path.js
CHANGED
package/old-names-mask.js
CHANGED
|
@@ -87,6 +87,13 @@ export function maskSimple(src, extension) {
|
|
|
87
87
|
if (extension === "sql" && src[span.start] === '"') continue;
|
|
88
88
|
blank(span.start, span.end);
|
|
89
89
|
}
|
|
90
|
+
// `@diagnose(DeprecatedDeclaration, ...)` names the compiler's warning groups, which nobody here can rename.
|
|
91
|
+
if (extension === "swift") {
|
|
92
|
+
for (const match of src.matchAll(/@diagnose\(([^)\n]*)\)/g)) {
|
|
93
|
+
const start = match.index + "@diagnose(".length;
|
|
94
|
+
blank(start, start + match[1].length);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
90
97
|
return text();
|
|
91
98
|
}
|
|
92
99
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyramzi/lint",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Shared oxlint rules, base config and gates for Studio projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@heyramzi/social": "^1.
|
|
83
|
+
"@heyramzi/social": "^1.2.0"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"voice:refresh": "node scripts/harvest-voice.mjs --write",
|
|
87
87
|
"test": "node --test \"*.test.mjs\""
|
|
88
88
|
}
|
|
89
|
-
}
|
|
89
|
+
}
|
package/repo-rules/packages.js
CHANGED
|
@@ -58,10 +58,15 @@ export function heyramziLinks(tree) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
const LOCK_ENTRY = /^ {2}'?(@heyramzi\/[^@']+)@([^'(:]+)'?:\s*$/;
|
|
61
|
+
const GITHUB_SCOPE = /^\s*@heyramzi:registry\s*=\s*https:\/\/npm\.pkg\.github\.com/m;
|
|
61
62
|
|
|
62
63
|
export function heyramziTarballs(tree) {
|
|
63
64
|
const found = [];
|
|
64
65
|
for (const file of tree.touchedMatching(/(^|\/)pnpm-lock\.yaml$/)) {
|
|
66
|
+
// Only a repo whose .npmrc sends @heyramzi to GitHub Packages needs the URL. One that leaves
|
|
67
|
+
// the scope on npmjs (Agency OS, client repos) resolves the canonical npmjs URL correctly.
|
|
68
|
+
const npmrc = file.replace(/pnpm-lock\.yaml$/, ".npmrc");
|
|
69
|
+
if (!GITHUB_SCOPE.test(tree.text(npmrc))) continue;
|
|
65
70
|
const lines = tree.text(file).split("\n");
|
|
66
71
|
lines.forEach((line, index) => {
|
|
67
72
|
const entry = LOCK_ENTRY.exec(line);
|
package/repo-rules/workflows.js
CHANGED
|
@@ -72,10 +72,17 @@ function nodeVersionFindings(file, lines, tree) {
|
|
|
72
72
|
return found;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/** npm trusted publishing (OIDC) trusts only GitHub-hosted runners, so that one shape may use one. */
|
|
76
|
+
function npmTrustedPublish(lines) {
|
|
77
|
+
const code = lines.map(yamlCode).join("\n");
|
|
78
|
+
return /^\s*id-token\s*:\s*write\b/m.test(code) && /\bnpm\s+publish\b/.test(code);
|
|
79
|
+
}
|
|
80
|
+
|
|
75
81
|
export function workflows(tree) {
|
|
76
82
|
const found = [];
|
|
77
83
|
for (const file of tree.touchedMatching(WORKFLOW)) {
|
|
78
84
|
const lines = tree.text(file).split("\n");
|
|
85
|
+
const hostedAllowed = npmTrustedPublish(lines);
|
|
79
86
|
const add = (rule, index, message) =>
|
|
80
87
|
found.push({
|
|
81
88
|
file,
|
|
@@ -87,7 +94,7 @@ export function workflows(tree) {
|
|
|
87
94
|
const runsOn = /^\s*runs-on\s*:\s*(.*)$/.exec(line);
|
|
88
95
|
if (runsOn) {
|
|
89
96
|
const value = runsOnValue(lines, index, runsOn[1].trim());
|
|
90
|
-
if (HOSTED.test(value) && !value.includes("self-hosted")) {
|
|
97
|
+
if (HOSTED.test(value) && !value.includes("self-hosted") && !hostedAllowed) {
|
|
91
98
|
add(
|
|
92
99
|
"workflow-runs-on",
|
|
93
100
|
index,
|
package/slop.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
/*
|
|
38
|
-
* Both lists are imported, never restated: `data/invisibles.js` and `data/slop
|
|
38
|
+
* Both lists are imported, never restated: `data/invisibles.js` and `data/slop/` are the one home for each.
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
import {
|
|
@@ -46,7 +46,9 @@ import {
|
|
|
46
46
|
invisibleKind,
|
|
47
47
|
isInvisible,
|
|
48
48
|
} from "#lint/data/invisibles.js";
|
|
49
|
-
import {
|
|
49
|
+
import { phrases, words } from "#lint/data/slop-words.js";
|
|
50
|
+
import { artifacts } from "#lint/data/slop/artifacts.js";
|
|
51
|
+
import { patterns } from "#lint/data/slop/patterns.js";
|
|
50
52
|
import { auditRegister } from "#lint/register.js";
|
|
51
53
|
import {
|
|
52
54
|
FAQ_TITLE,
|
package/ui-rules.js
CHANGED
|
@@ -15,6 +15,8 @@ export const DEFAULT_IGNORED = [
|
|
|
15
15
|
"out",
|
|
16
16
|
"coverage",
|
|
17
17
|
"vendor",
|
|
18
|
+
// What a client sent us, kept as it came: company/clients/<slug>/inputs/.
|
|
19
|
+
"inputs",
|
|
18
20
|
".upstream",
|
|
19
21
|
"generated",
|
|
20
22
|
"_generated",
|
|
@@ -37,7 +39,7 @@ export const DEFAULT_IGNORED = [
|
|
|
37
39
|
const T_FAMILIES =
|
|
38
40
|
"avatar|check|clear|digit|dropdown|enter|error|exit|fade|fly|follow|glare|hold|input|learn|lift|like|mask|modal|morph|page|pop|press|reel|resize|return|scrollbar|shake|shimmer|stagger|success|swap|text|think|tilt|acc|tabs|toast|tooltip|number|badge|panel|toggle|banner|matrix|stream|reason|skeleton|accordion";
|
|
39
41
|
|
|
40
|
-
const TOKEN_NAMES = "stagger|micro|quick|fast|medium|slow|
|
|
42
|
+
const TOKEN_NAMES = "stagger|micro|quick|fast|medium|slow|overlay|loop";
|
|
41
43
|
|
|
42
44
|
const MESSAGES = {
|
|
43
45
|
"transition-all":
|
|
@@ -47,7 +49,7 @@ const MESSAGES = {
|
|
|
47
49
|
"ease-in":
|
|
48
50
|
"Use `var(--ease-smooth-out)` (or `ease-out`). `ease-in` starts slow, delaying the exact moment the user is watching. `ease-in-out` is fine for on-screen movement.",
|
|
49
51
|
"duration-literal":
|
|
50
|
-
"Write `duration-[var(--duration-fast)]` and `delay-[var(--duration-micro)]`, never a literal. Tokens: stagger, micro, quick, fast, medium, slow,
|
|
52
|
+
"Write `duration-[var(--duration-fast)]` and `delay-[var(--duration-micro)]`, never a literal. Tokens: stagger, micro, quick, fast, medium, slow, overlay, loop.",
|
|
51
53
|
"duration-bare":
|
|
52
54
|
"Write `duration-[var(--duration-fast)]`, never `duration-fast`. Tailwind's `duration-*` resolves against `--transition-duration-*`, so a bare token class generates nothing and sits at 0s.",
|
|
53
55
|
"acc-panel-padding":
|