Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
57fb708
Reconfigure eslint to work with prettier
judah-sotomayor Jul 10, 2025
b88ca91
Apply eslint auto-fixes.
judah-sotomayor Jul 10, 2025
8d666e8
Add block scope to cases in src/lib/video/index.ts
judah-sotomayor Jul 10, 2025
cc0f194
Split bkk.chapters expectation into two tests.
judah-sotomayor Jul 10, 2025
eafb9b2
ESLint ignore require import in tailwind config.
judah-sotomayor Jul 10, 2025
d9e545a
Make firstTwoChars const in lexicon/+page.ts.
judah-sotomayor Jul 10, 2025
0c06134
Create block scope around case in contents/[id]/+page.svelte.
judah-sotomayor Jul 10, 2025
6a04932
Fix toBeDefined() function call in worker-messenger test.
judah-sotomayor Jul 10, 2025
769f3e5
Fix toBeDefined() call in search data test.
judah-sotomayor Jul 10, 2025
8ff2939
Make results const in searchDictionary.
judah-sotomayor Jul 10, 2025
73b449b
Replace calls to hasOwnProperty.
judah-sotomayor Jul 10, 2025
d1f6d28
Satisfy ESLint with comment in lib/data/scripture.js.
judah-sotomayor Jul 10, 2025
8a67ec3
Remove empty object types from CatalogData.
judah-sotomayor Jul 10, 2025
d9b7c00
Change sourceMp3 to a const in lib/data/audio.ts.
judah-sotomayor Jul 10, 2025
f7072e3
Add block around darwin case in example/index.js.
judah-sotomayor Jul 10, 2025
ca72c94
Add block around case in BottomNavigationBar.
judah-sotomayor Jul 10, 2025
0a37760
Replace ugly one-line comparision in Sidebar.
judah-sotomayor Jul 10, 2025
104721d
Update eslint-plugin-svelte.
judah-sotomayor Jul 10, 2025
cd90be2
Disable eslint each-block warnings.
judah-sotomayor Jul 10, 2025
2c73dd3
Fix useless moustaches.
judah-sotomayor Jul 10, 2025
7cd2390
Disable svelte/no-unused-svelte-ignore eslint rule.
judah-sotomayor Jul 10, 2025
25b19dd
Silence spurious goto warnings.
judah-sotomayor Jul 10, 2025
10b5c29
Fix font-family misspelling in FontList.svelte.
judah-sotomayor Jul 10, 2025
5585aff
Apply prettier changes.
judah-sotomayor Jul 10, 2025
740a9ee
Add `curly` rule to eslint, fix errors.
judah-sotomayor Jul 11, 2025
cdce158
Move globals, typescript-eslint to devDependencies.
judah-sotomayor Jul 11, 2025
760760b
Disable eslint for @html in about page.
judah-sotomayor Jul 12, 2025
4c69395
Ignore remaining eslint errors.
judah-sotomayor Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .eslintrc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions convert/convertBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function handleNoCaptionFigures(text: string, _bcId: string, _bookId: string): s
const parts = figContent.split('|');

// Extract the image caption
let imageCaption = parts[0];
const imageCaption = parts[0];

// Check if the image caption is missing
if (!imageCaption) {
Expand Down Expand Up @@ -236,7 +236,7 @@ function moveFigureToNextNonVerseMarker(text: string): string {
let carryOverFigures: string[] = [];

const lines = text.split('\n');
for (let line of lines) {
for (const line of lines) {
// Add any figures that were carried over from the previous lines
if (carryOverFigures.length > 0) {
if (!line.startsWith('\\v ') && !line.startsWith('\\fig')) {
Expand Down
6 changes: 3 additions & 3 deletions convert/convertConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ export function parseDictionaryWritingSystem(

export function parseMenuLocalizations(document: Document, verbose: number) {
const translationMappingsTags = document.getElementsByTagName('translation-mappings');
let translationMappings: {
const translationMappings: {
defaultLang: string;
mappings: Record<string, Record<string, string>>;
} = {
Expand Down Expand Up @@ -987,7 +987,7 @@ export function parseAnalytics(document: Document, verbose: number) {

export function parseFirebase(document: Document, verbose: number) {
const firebaseElements = document.getElementsByTagName('firebase');
let firebase: { features: { [key: string]: any } } = { features: {} };
const firebase: { features: { [key: string]: any } } = { features: {} };

// Iterate over firebaseElements and update data.firebase.features
for (const firebaseElement of firebaseElements) {
Expand Down Expand Up @@ -1161,7 +1161,7 @@ export function parseIllustrations(document: Document, verbose: number) {

export function parseLayouts(document: Document, bookCollections: any, verbose: number) {
const layoutRoot = document.getElementsByTagName('layouts')[0];
let defaultLayout = layoutRoot?.getAttribute('default');
const defaultLayout = layoutRoot?.getAttribute('default');
const layouts = [];

const layoutTags = layoutRoot?.getElementsByTagName('layout');
Expand Down
2 changes: 1 addition & 1 deletion convert/convertReverseIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class ConvertReverseIndex extends Task {
throw new Error('No writing systems found in config data');
}

let files: FileContent[] = [];
const files: FileContent[] = [];
for (const lang in configOutput.data.writingSystems) {
const writingSystem = configOutput.data.writingSystems[lang];

Expand Down
3 changes: 2 additions & 1 deletion convert/tests/sab/convertConfigSAB.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ if (programType === 'DAB') {
expect(bc.books).not.toHaveLength(0);
for (const bk in bc.books) {
const bkk = bc.books[bk];
expect(bkk.chapters).not.toBe(0 || undefined);
expect(bkk.chapters).not.toBe(0);
expect(bkk.chapters).toBeDefined();
expect(bkk.chaptersN).not.toSatisfy((r) => r === '' || r === undefined);
expect(bkk.id).not.toSatisfy((r) => r === '' || r === undefined);
expect(bkk.name).not.toSatisfy((r) => r === '' || r === undefined);
Expand Down
74 changes: 72 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
export default [
// eslint.config.js

import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier/flat'; // If you want to use eslint --inspect-config, rewrite as `flat.js`.
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';
import svelteConfig from './svelte.config.js';

export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs.recommended,
...svelte.configs.prettier,
eslintConfigPrettier,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
// See more details at: https://typescript-eslint.io/packages/parser/
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.svelte'], // Add support for additional file extensions, such as .svelte
parser: ts.parser,
// Specify a parser for each language, if needed:
// parser: {
// ts: ts.parser,
// js: espree, // Use espree for .js files (add: import espree from 'espree')
// typescript: ts.parser
// },

// We recommend importing and specifying svelte.config.js.
// By doing so, some rules in eslint-plugin-svelte will automatically read the configuration and adjust their behavior accordingly.
// While certain Svelte settings may be statically loaded from svelte.config.js even if you don’t specify it,
// explicitly specifying it ensures better compatibility and functionality.
svelteConfig
}
}
},
{
rules: {
// Override or add rule settings here, such as:
// 'svelte/rule-name': 'error'
'svelte/no-navigation-without-base': 'error', // Necessary since hash-based navigation.
'svelte/no-dupe-style-properties': 'off', // Height is duplicated with dvh and vh for compatibility.
'svelte/require-each-key': 'off', // Most each-blocks in this app do not have keys, and do not seem to need them.
'svelte/no-unused-svelte-ignore': 'off', // Svelte ignores that are unused by eslint may be used by LSP.
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'no-tabs': 'error',
'no-undef': 'off', // Covered by TS, and eslint false flags some globals
'no-inner-declarations': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-self-assign': 'off'
}
},
{
ignores: [
'.DS_Store',
Expand All @@ -18,5 +80,13 @@ export default [
'package-lock.json',
'yarn.lock'
]
},

// Ignore certain rules for typescript config
{
files: ['tailwind.config.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off'
}
}
];
);
3 changes: 2 additions & 1 deletion example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ const getExecutionCommand = (program: string): string => {
javaPath = path.join(process.env['JAVA_HOME'], 'bin', 'java');
}
switch (os.platform()) {
case 'darwin':
case 'darwin': {
const appPath = `/Applications/${appName}.app/Contents`;
javaPath = `"${appPath}/Plugins/zulu-17.jdk/Contents/Home/jre/bin/java"`;
return `${javaPath} -jar "${appPath}/Resources/Java/bin/${jarName}"`;
}
case 'win32': {
const programFilesX86 = process.env['ProgramFiles(x86)'];
if (!programFilesX86) {
Expand Down
Loading
Loading