aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-24 21:39:24 -0500
committerGitHub <noreply@github.com>2023-12-25 02:39:24 +0000
commitc22425b10afb60820e2165ac5f420b4a1754658a (patch)
tree9baa544b1cad46d24447253b0c4818129519bea4
parent83ebc13bb9a83ef6be4d96d88f389e588924225b (diff)
Whitespace rules (#441)
* Update whitespace rules * Typescript rules
-rw-r--r--.eslintrc.json16
-rw-r--r--test/database.test.js1
-rw-r--r--types/ext/dictionary-importer-media-loader.d.ts1
-rw-r--r--types/ext/offscreen.d.ts1
4 files changed, 16 insertions, 3 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index bd90f4fc..abef43b1 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -61,6 +61,12 @@
"no-case-declarations": "error",
"no-const-assign": "error",
"no-constant-condition": "off",
+ "no-multiple-empty-lines": [
+ "error",
+ {
+ "max": 2
+ }
+ ],
"no-global-assign": "error",
"no-new": "error",
"no-param-reassign": "off",
@@ -211,6 +217,10 @@
"after": true
}
],
+ "space-before-blocks": [
+ "error",
+ "always"
+ ],
"space-before-function-paren": [
"error",
{
@@ -392,6 +402,12 @@
"*.ts"
],
"rules": {
+ "no-multiple-empty-lines": [
+ "error",
+ {
+ "max": 1
+ }
+ ],
"no-undef": "off",
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-unused-vars": [
diff --git a/test/database.test.js b/test/database.test.js
index 4a52f18d..c99cf57c 100644
--- a/test/database.test.js
+++ b/test/database.test.js
@@ -103,7 +103,6 @@ function countKanjiWithCharacter(kanji, character) {
}
-
/** */
async function testDatabase1() {
test('Database1', async () => {
diff --git a/types/ext/dictionary-importer-media-loader.d.ts b/types/ext/dictionary-importer-media-loader.d.ts
index afbb1902..f56d7cf6 100644
--- a/types/ext/dictionary-importer-media-loader.d.ts
+++ b/types/ext/dictionary-importer-media-loader.d.ts
@@ -30,7 +30,6 @@ export type GetImageDetailsFunction = (
transfer?: Transferable[]
) => Promise<{content: ArrayBuffer, width: number, height: number}>;
-
export type GenericMediaLoader = {
getImageDetails: GetImageDetailsFunction;
};
diff --git a/types/ext/offscreen.d.ts b/types/ext/offscreen.d.ts
index 2046bfe0..511c32bd 100644
--- a/types/ext/offscreen.d.ts
+++ b/types/ext/offscreen.d.ts
@@ -108,7 +108,6 @@ export type FindKanjiOptionsOffscreen = Omit<Translation.FindKanjiOptions, 'enab
][];
};
-
export type FindTermsOptionsOffscreen = Omit<Translation.FindTermsOptions, 'enabledDictionaryMap' | 'excludeDictionaryDefinitions' | 'textReplacements'> & {
enabledDictionaryMap: [
key: string,