Skip to content

Commit 2e1241b

Browse files
committed
chore(eslint): fix all 48 lint errors across 8 files
Remove dead code (normalizeAccidentals, countRows, unused imports), fix useless escapes in CSS comments, scope Node/browser globals to the files that need them, ignore tree-sitter DSL globals, and replace no-explicit-any cast in element.test.ts with a type-safe approach.
1 parent 4c9f345 commit 2e1241b

7 files changed

Lines changed: 16 additions & 17 deletions

File tree

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,22 @@ export default tseslint.config(
4747
],
4848
},
4949
},
50+
{
51+
files: ['packages/*/.eleventy.js', 'packages/website/content/_data/**/*.js'],
52+
languageOptions: { globals: globals.node },
53+
},
54+
{
55+
files: ['packages/website/assets/js/**/*.js'],
56+
languageOptions: { globals: globals.browser },
57+
},
5058
{
5159
ignores: [
5260
'**/generated.js',
5361
'**/generated.d.ts',
5462
'**/dist/**',
5563
'**/_site/**',
5664
'**/node_modules/**',
65+
'packages/tree-sitter-grammar/grammar.js',
5766
],
5867
},
5968
);

packages/font-explorer/.eleventy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function (eleventyConfig) {
1+
export default function (_eleventyConfig) {
22
return {
33
dir: {
44
input: 'content',

packages/grigson-grille-harmonique-renderer/src/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function getGrilleStyles(typeface: string = 'sans'): string {
9393
transform: translate(-50%, -50%) rotate(var(--cg-diag-angle));
9494
}
9595
96-
/* Full "\" anti-diagonal: top-left to bottom-right */
96+
/* Full "\\" anti-diagonal: top-left to bottom-right */
9797
[part~="line-anti"] {
9898
width: var(--cg-diag-len);
9999
transform: translate(-50%, -50%) rotate(calc(-1 * var(--cg-diag-angle)));
@@ -128,7 +128,7 @@ export function getGrilleStyles(typeface: string = 'sans'): string {
128128
transform: translate(-50%, -50%) rotate(var(--cg-diag-angle));
129129
}
130130
131-
/* Half-length "\" lines — centered in their quadrant */
131+
/* Half-length "\\" lines — centered in their quadrant */
132132
[part~="line-anti-tl"] {
133133
width: calc(var(--cg-diag-len) / 2);
134134
top: 25%;

packages/grigson/src/element.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,12 @@ describe('GrigsonChart DSD adoption', () => {
485485
// parser does). Instead we add content to the existing shadow root and force
486486
// _hasDSDContent = true before connecting to simulate DSD adoption.
487487
const makeElementWithDSD = () => {
488-
const el = document.createElement('grigson-chart') as any;
488+
const el = document.createElement('grigson-chart');
489489
const sentinel = document.createElement('div');
490490
sentinel.setAttribute('data-dsd', 'true');
491-
el.shadowRoot.appendChild(sentinel);
492-
el._hasDSDContent = true;
493-
return el as GrigsonChart;
491+
el.shadowRoot!.appendChild(sentinel);
492+
Object.assign(el, { _hasDSDContent: true });
493+
return el as unknown as GrigsonChart;
494494
};
495495

496496
it('adopts a DSD shadow root without re-rendering', async () => {

packages/grigson/src/renderers/html.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,10 +1048,6 @@ describe('getRendererFontFaceCSS', () => {
10481048
// reflowSong and splitRows
10491049
// ---------------------------------------------------------------------------
10501050

1051-
function countRows(song: ReturnType<typeof parseSong>): number {
1052-
return song.sections.reduce((sum, s) => sum + s.rows.length, 0);
1053-
}
1054-
10551051
describe('reflowSong', () => {
10561052
it('no-op when rows already have N bars each', () => {
10571053
// 2 rows × 4 bars = 8 bars total → barsPerLine=4 gives same 2 rows

packages/grigson/src/renderers/html.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ export function computeGlobalLayout(song: Song): GlobalLayout {
332332
// Chord rendering
333333
// ---------------------------------------------------------------------------
334334

335-
function normalizeAccidentals(text: string): string {
336-
return text.replace(/b/g, '♭').replace(/#/g, '♯');
337-
}
338-
339335
type AccidentalsMode = 'unicode' | 'ascii';
340336
type SlashStyle = 'horizontal' | 'diagonal' | 'ascii';
341337

packages/grigson/src/theory/harmonicAnalysis.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import type {
77
Song,
88
Section,
99
Bar,
10-
BeatCell,
11-
ChordCell,
1210
DotCell,
1311
Row,
1412
CommentLine,

0 commit comments

Comments
 (0)