@grailwind/eslint-plugin 0.1.0-beta.1 → 0.1.0-beta.3
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 +6 -6
- package/package.json +2 -2
- package/src/blazon.js +19 -1
- package/src/rules/rule-of-tincture.js +2 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install --save-dev @grailwind/eslint-plugin@beta
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
It reads the tinctures, ordinaries and charges from your installed `grailwind`, so it needs
|
|
16
|
-
`grailwind` 0.
|
|
16
|
+
`grailwind` 0.7.x. For typos and other class errors, see
|
|
17
17
|
[Linting](https://github.com/pafirmin/grailwind#linting) in the Grailwind README.
|
|
18
18
|
|
|
19
19
|
## Setup
|
|
@@ -57,8 +57,8 @@ export default [
|
|
|
57
57
|
No metal (`or`, `argent`) on metal, and no colour on colour.
|
|
58
58
|
|
|
59
59
|
- An ordinary, chief or bordure is checked against the field on the same element:
|
|
60
|
-
`escutcheon or fess-argent` is metal on metal. So are engrailed and
|
|
61
|
-
(`fess-engrailed-argent`).
|
|
60
|
+
`escutcheon or fess-argent` is metal on metal. So are engrailed, invected and voided ones
|
|
61
|
+
(`fess-engrailed-argent`, `cross-voided-argent`).
|
|
62
62
|
- A fimbriated ordinary is checked against its fimbriation, and the fimbriation against the
|
|
63
63
|
field: `or chevron-sable fimbriated-argent` is metal on metal (Argent on Or).
|
|
64
64
|
- Charges in a `charges` container are checked against the field.
|
|
@@ -104,7 +104,7 @@ one, other than a chief, they have nowhere to go.
|
|
|
104
104
|
An element draws one ordinary plus, optionally, a chief. With two, such as
|
|
105
105
|
`fess-azure chevron-gules`, only one shows. Two chiefs are flagged too. A `charges` container
|
|
106
106
|
takes one arrangement: `between`, `on`, `in-pale`, `in-fess`, `in-bend` or `in-bend-sinister`.
|
|
107
|
-
Counterchanged, engrailed, invected and fur ordinaries count as ordinaries.
|
|
107
|
+
Counterchanged, engrailed, invected, voided and fur ordinaries count as ordinaries.
|
|
108
108
|
|
|
109
109
|
A charge at a named point (`in-dexter-chief` and so on) is a separate group in the blazon, so it
|
|
110
110
|
goes in its own `charges` container. Among other charges, it still counts towards their number
|
|
@@ -119,8 +119,8 @@ Modifiers that would otherwise do nothing:
|
|
|
119
119
|
element, e.g. `per-pale-argent-gules`.
|
|
120
120
|
- `counterchanged` on `charges`, or on a charge, needs a divided field on the shield that holds
|
|
121
121
|
the container.
|
|
122
|
-
- `fimbriated-*` needs a plain tinctured ordinary. A chief, and an engrailed, invected,
|
|
123
|
-
counterchanged ordinary, aren't fimbriated.
|
|
122
|
+
- `fimbriated-*` needs a plain tinctured ordinary. A chief, and an engrailed, invected, voided,
|
|
123
|
+
fur or counterchanged ordinary, aren't fimbriated.
|
|
124
124
|
- `counterchanged` doesn't work on a charge with a transform (`rotate-*`, `scale-*`, `skew-*`,
|
|
125
125
|
`translate-*`): the charge shows its own small copy of the field instead.
|
|
126
126
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grailwind/eslint-plugin",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"description": "ESLint rules for Grailwind heraldry markup: the rule of tincture and charge structure",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@html-eslint/parser": "*",
|
|
28
28
|
"eslint": "^9.0.0 || ^10.0.0",
|
|
29
|
-
"grailwind": "^0.
|
|
29
|
+
"grailwind": "^0.7.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"@html-eslint/parser": {
|
package/src/blazon.js
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
POINTS,
|
|
16
16
|
ROUNDELS,
|
|
17
17
|
TINCTURES,
|
|
18
|
+
VOIDABLE,
|
|
18
19
|
} from "grailwind/data";
|
|
19
20
|
|
|
20
21
|
const METAL = new Set(METALS);
|
|
@@ -47,6 +48,23 @@ for (const ordinary of ORDINARIES) {
|
|
|
47
48
|
counterchanged: true,
|
|
48
49
|
});
|
|
49
50
|
}
|
|
51
|
+
for (const ordinary of VOIDABLE) {
|
|
52
|
+
for (const tincture of PAINT) {
|
|
53
|
+
const fur = FUR.has(tincture);
|
|
54
|
+
ORDINARY_CLASSES.set(`${ordinary}-voided-${tincture}`, {
|
|
55
|
+
ordinary,
|
|
56
|
+
tincture,
|
|
57
|
+
fur,
|
|
58
|
+
voided: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
ORDINARY_CLASSES.set(`${ordinary}-voided-counterchanged`, {
|
|
62
|
+
ordinary,
|
|
63
|
+
tincture: null,
|
|
64
|
+
counterchanged: true,
|
|
65
|
+
voided: true,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
50
68
|
for (const tincture of [...TINCTURES, OF_THE_FIRST]) {
|
|
51
69
|
ORDINARY_CLASSES.set(`bordure-${tincture}`, { ordinary: "bordure", tincture });
|
|
52
70
|
}
|
|
@@ -64,7 +82,7 @@ for (const division of DIVISIONS) {
|
|
|
64
82
|
}
|
|
65
83
|
|
|
66
84
|
// Only a plain, tinctured ordinary is fimbriated (see ordinaries.js).
|
|
67
|
-
export const isFimbriable = (o) => !o.counterchanged && !o.line && !o.fur;
|
|
85
|
+
export const isFimbriable = (o) => !o.counterchanged && !o.line && !o.fur && !o.voided;
|
|
68
86
|
|
|
69
87
|
export const isFur = (tincture) => FUR.has(tincture);
|
|
70
88
|
|
|
@@ -23,7 +23,8 @@ const article = (thing) => (/^[aeiou]/.test(thing) ? `an ${thing}` : `a ${thing}
|
|
|
23
23
|
const KINDS = ["metal", "colour", "exempt"];
|
|
24
24
|
|
|
25
25
|
// e.g. "fess engrailed", as blazoned.
|
|
26
|
-
const name = ({ ordinary, line }) =>
|
|
26
|
+
const name = ({ ordinary, line, voided }) =>
|
|
27
|
+
describe([ordinary, line, voided && "voided"].filter(Boolean).join(" "));
|
|
27
28
|
|
|
28
29
|
// e.g. " (ermine counts as a metal)", or " (ermine and erminois count as metals)".
|
|
29
30
|
const furNote = (tinctures, kind) => {
|