Skip to content

Commit 08c941b

Browse files
committed
Add eslint-plugin-jsdoc
1 parent a8e1420 commit 08c941b

File tree

10 files changed

+222
-17
lines changed

10 files changed

+222
-17
lines changed

eslint.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FlatCompat } from "@eslint/eslintrc";
22
import { fileURLToPath } from "node:url";
33
import globals from "globals";
44
import js from "@eslint/js";
5+
import jsdoc from 'eslint-plugin-jsdoc';
56
import path from "node:path";
67

78
const __filename = fileURLToPath( import.meta.url );
@@ -15,6 +16,7 @@ const compat = new FlatCompat( {
1516
export default[
1617
...compat.extends( "eslint:all" ),
1718
...compat.extends( "eslint:recommended" ),
19+
jsdoc.configs[ 'flat/recommended-typescript-flavor' ],
1820
{
1921
ignores: [ "node_modules/*" ],
2022
languageOptions: {
@@ -37,7 +39,16 @@ export default[
3739
sourceType: "commonjs",
3840
},
3941

42+
plugins: {
43+
jsdoc,
44+
},
45+
4046
rules: {
47+
"jsdoc/require-description": "off",
48+
"jsdoc/require-param-description": "off",
49+
"jsdoc/require-returns-description": "off",
50+
"jsdoc/require-jsdoc": "off",
51+
"jsdoc/require-returns": "off",
4152
"array-bracket-spacing": [ "error", "always" ],
4253
"brace-style": [ "error", "allman" ],
4354
"camelcase": "off",

options/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
let starDismissed = false;
5050
const checkboxes = document.querySelectorAll( '.option-check:not(:disabled)' );
5151

52-
/** @type {Object.<string, HTMLElement[]>} */
52+
/** @type {Record<string, HTMLElement[]>} */
5353
const options =
5454
{
5555
'clicked-star': null,

package-lock.json

Lines changed: 162 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@types/firefox-webext-browser": "^120.0.3",
2020
"archiver": "^7.0.1",
2121
"eslint": "^9.10.0",
22+
"eslint-plugin-jsdoc": "^50.6.3",
2223
"prettier": "^3.3.2",
2324
"stylelint": "^16.5.0",
2425
"stylelint-config-standard": "^37.0.0",

scripts/background.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function GetApp( appid, callback )
359359
}
360360

361361
/**
362-
* @param {Object} obj
362+
* @param {object} obj
363363
* @param {string} obj.appid
364364
* @param {string} obj.currency
365365
* @param {(obj: {success: true}|{success: false, error: string}) => void} callback
@@ -580,7 +580,7 @@ function StoreRemoveFreeLicense( request, callback )
580580
}
581581

582582
/**
583-
* @param {Record<string, string>} request
583+
* @param {Record<string, string>} request
584584
* @param {(obj: {success: boolean, granted: boolean}) => void} callback
585585
*/
586586
function StoreRequestPlaytestAccess( request, callback )
@@ -615,6 +615,7 @@ function StoreRequestPlaytestAccess( request, callback )
615615
* @param {string} path
616616
* @param {FormData} formData
617617
* @param {(obj: {success: true}|{success: false, error: string}) => void} callback
618+
* @param {boolean} rawCallback
618619
*/
619620
function ExecuteStoreApiCall( path, formData, callback, rawCallback = false )
620621
{
@@ -743,15 +744,16 @@ function GetStoreSessionID( callback )
743744

744745
/**
745746
* @param {{[key: string]: any}} items
746-
* @return Promise<{[key: string]: any}>
747+
* @returns {Promise<{[key: string]: any}>}
747748
*/
748749
function GetLocalOption( items )
749750
{
750751
return ExtensionApi.storage.local.get( items );
751752
}
752753

753754
/**
754-
* @param {String} option
755+
* @param {string} option
756+
* @param {any} value
755757
*/
756758
function SetLocalOption( option, value )
757759
{

scripts/common.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ var ExtensionApi = ( () =>
2424
var CurrentAppID;
2525

2626
/**
27-
* @param {String} url
28-
* @returns {Number}
27+
* @param {string} url
28+
* @returns {number}
2929
*/
3030
function GetAppIDFromUrl( url )
3131
{
@@ -50,9 +50,9 @@ function GetHomepage()
5050
}
5151

5252
/**
53-
* @param {String} message
54-
* @param {String[]} substitutions
55-
* @returns {String}
53+
* @param {string} message
54+
* @param {string[]} substitutions
55+
* @returns {string}
5656
*/
5757
function _t( message, substitutions = [] )
5858
{
@@ -79,7 +79,8 @@ function GetOption( items, callback )
7979
}
8080

8181
/**
82-
* @param {String} option
82+
* @param {string} option
83+
* @param {any} value
8384
*/
8485
function SetOption( option, value )
8586
{
@@ -90,7 +91,7 @@ function SetOption( option, value )
9091
}
9192

9293
/**
93-
* @param {String} res
94+
* @param {string} res
9495
*/
9596
function GetLocalResource( res )
9697
{
@@ -99,7 +100,7 @@ function GetLocalResource( res )
99100

100101
/**
101102
* @callback SendMessageToBackgroundScriptCallback
102-
* @param {{success: Boolean, error?: String, data?: any}?} data
103+
* @param {{success: boolean, error?: string, data?: any}?} data
103104
*/
104105

105106
/**

0 commit comments

Comments
 (0)