Commit 367ad79
Reconfigure ESLint to work well with prettier (#957)
* Reconfigure eslint to work with prettier
Add a proper eslint configuration using extensions for svelte,
typescript, and prettier.
This should ensure eslint does not mess with prettier's settings while
still enabling high-quality linting.
Remove the outdated .eslintrc.cjs in favor of eslint.config.js.
* Apply eslint auto-fixes.
Mainly converting let to const, and var to let.
* Add block scope to cases in src/lib/video/index.ts
This change corrects video/index.ts to comply with
`no-case-declarations`.
`getEmbeddedVideoUrl` was using `let` and `const` declarations inside
cases without an appropriate block scope on each case.
As a result of this sloppiness, reused variable names were falling
through suspiciously.
This change adds a block scope to each case, and makes any local
`pattern` and `match` variables const.
* Split bkk.chapters expectation into two tests.
Satisfy eslint by breaking up the expect on bkk.chapters in
convert/tests/sab/convertConfigSAB.test.ts to a separate 0-check and undefined-check.
Jest also notes that using toBeDefined() is better than a raw undefined
check.
https://jestjs.io/docs/expect#tobedefined
* ESLint ignore require import in tailwind config.
Tell eslint to ignore the require import rule for tailwind's
configuration.
Require seems to be a standard import mechanism for tailwind: https://v2.tailwindcss.com/docs/configuration#plugins
* Create block scope around case in contents/[id]/+page.svelte.
* Fix toBeDefined() function call in worker-messenger test.
Function wasn't being called, lol.
* Fix toBeDefined() call in search data test.
Function wasn't being called, lol.
* Make results const in searchDictionary.
`dab-search-worker.ts`'s `searchDictionary()` did not assign to
`results` after it was set. Declare `results` as `const`.
* Replace calls to hasOwnProperty.
Instead of calling hasOwnProperty off of an object directly, use
`Object.property` to make the call.
This avoids potential subtle problems, explained in this link:
https://eslint.org/docs/latest/rules/no-prototype-builtins#rule-details
* Satisfy ESLint with comment in lib/data/scripture.js.
Doesn't like empty blocks, as they may be confusing.
* Remove empty object types from CatalogData.
Replace empty object types (`{}`) with `object`.
This prevents random values from being inserted into the interface.
Could be a BREAKING CHANGE!
* Change sourceMp3 to a const in lib/data/audio.ts.
Previously used `var`.
* Add block around darwin case in example/index.js.
Other OS's had blocks, not sure why MacOS missed out.
* Add block around case in BottomNavigationBar.
BottomNavigationBar's `handleclick()` used a `let` binding inside a
case. Refactor to add a block around the case.
* Replace ugly one-line comparision in Sidebar.
Sidebar was using a bash-style `and` shortcut instead of a proper `if`.
Fix it.
* Disable `svelte/no-dupe-style-properties` as it is very noisy.
* Disable eslint each-block warnings.
Don't warn about missing keys in each-blocks.
* Fix useless moustaches.
Remove brackets surrounding literal values.
* Disable svelte/no-unused-svelte-ignore eslint rule.
This rule triggers a warning on statements that eslint does not use, but
the svelte LSP does use.
* Silence spurious goto warnings.
Several `goto` statements are used without reference to `{base}` because
they use a parameter instead of a literal url.
Silence `eslint` warnings on those in particular.
* Fix font-family misspelling in FontList.svelte.
A link element attempted to set the font-family style attribute, but
misspelled it as "font-famly".
Correct spelling.
* Apply prettier changes.
* Add `curly` rule to eslint, fix errors.
Add the `curly` rule to enforce use of braces in if-statements.
Then run `eslint . --fix` to correct all violations, and `prettier
--write .` to reformat.
* Disable eslint for @html in about page.
* Ignore/resolve remaining eslint errors.
* Ignore extracted CI projects folder
---------
Co-authored-by: Judah Sotomayor <judah.sotomayor@pm.me>1 parent 62aa25a commit 367ad79
74 files changed
Lines changed: 2496 additions & 2160 deletions
File tree
- convert
- tests/sab
- example
- src
- lib
- components
- data
- stores
- lexicon/components
- scripts
- search-worker
- data
- repositories
- domain/test
- search
- data/test
- domain
- utils/worker-messenger
- video
- routes
- about
- contents/[id]
- dev/icons
- lexicon
- plans/[id]
- quiz/[collection]/[id]
- search/[collection]/[[savedResults]]
- text
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
| |||
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
506 | | - | |
| 507 | + | |
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
| |||
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
526 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
527 | 530 | | |
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
531 | 534 | | |
532 | 535 | | |
533 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
534 | 539 | | |
535 | 540 | | |
536 | 541 | | |
| |||
556 | 561 | | |
557 | 562 | | |
558 | 563 | | |
559 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
| |||
583 | 590 | | |
584 | 591 | | |
585 | 592 | | |
586 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
587 | 596 | | |
588 | 597 | | |
589 | 598 | | |
| |||
789 | 798 | | |
790 | 799 | | |
791 | 800 | | |
792 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
793 | 804 | | |
794 | 805 | | |
795 | 806 | | |
| |||
860 | 871 | | |
861 | 872 | | |
862 | 873 | | |
863 | | - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
864 | 877 | | |
865 | 878 | | |
866 | 879 | | |
| |||
933 | 946 | | |
934 | 947 | | |
935 | 948 | | |
936 | | - | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
937 | 952 | | |
938 | 953 | | |
939 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
940 | 957 | | |
941 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
942 | 961 | | |
943 | 962 | | |
944 | 963 | | |
945 | 964 | | |
946 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
947 | 968 | | |
948 | 969 | | |
949 | 970 | | |
| |||
0 commit comments