Skip to content

Commit

Permalink
feat: use eslint-plugin-jsdoc #555 (#556)
Browse files Browse the repository at this point in the history
* feat: use `eslint-plugin-jsdoc` #555

* fix: fix lint errors
  • Loading branch information
Robot-Inventor authored Mar 15, 2024
1 parent 1b8f3da commit b706013
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"eslint:all",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jsdoc/recommended-typescript-error",
"prettier"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
"@typescript-eslint",
"jsdoc"
],
"root": true,
"parserOptions": {
Expand Down
102 changes: 102 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"devDependencies": {
"@types/addons-linter": "^6.16.0",
"@types/webextension-polyfill": "^0.10.4",
"eslint-plugin-jsdoc": "^48.2.1",
"knip": "^5.0.0"
}
}
1 change: 0 additions & 1 deletion src/ts/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const onUpdated = (details: browser.Runtime.OnInstalledDetailsType, isJapanese:
/**
* This function is called when the extension is installed.
* This function opens the onboarding page.
* @param isJapanese if the user's language is Japanese
*/
const onInstalled = (): void => {
const url = browser.runtime.getURL(ONBOARDING_PATH);
Expand Down
4 changes: 0 additions & 4 deletions src/ts/components/sbsMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ class SbsMessage extends LitElement {
@property({ reflect: true, type: String })
public textColor = "white";

/**
* This is a comment to disable Knip.
* @public
*/
public static styles = css`
* {
font-family: sans-serif;
Expand Down
1 change: 1 addition & 0 deletions src/ts/core/parser/parserBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ParserBase {

/**
* Get the React props.
* @param element element to parse
* @returns React props
*/
protected getProps(element: Element = this.sourceElement): unknown {
Expand Down
7 changes: 6 additions & 1 deletion src/ts/core/translationKeyProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TranslationKeyProvider {

/**
* Get the message summary from the tweet analysis result.
* @param status tweet analysis result
* @param analyzer tweet analysis result
* @returns message summary
*/
private static summarizeForTweet(analyzer: TweetAnalysisResult): TranslationKey {
Expand Down Expand Up @@ -61,6 +61,11 @@ class TranslationKeyProvider {
return formattedText;
}

/**
* Get the account details from the tweet analysis result.
* @param analyzer tweet analysis result
* @returns account details
*/
private static getAccountDetails(analyzer: TweetAnalysisResult): SbsMessageDetails {
const accountStatus = analyzer.user.shadowbanned
? "accountIsShadowbannedOrFlaggedAsSensitive"
Expand Down

0 comments on commit b706013

Please sign in to comment.