Skip to content

Commit

Permalink
"Remove" unused exports.
Browse files Browse the repository at this point in the history
Add ESLint rule to trow an Error when linting and detecting an unused
export and update a code accordingly to that rule.
  • Loading branch information
SpacingBat3 committed Jul 24, 2022
1 parent bb85b1a commit f0fc7f0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
Expand Down Expand Up @@ -57,6 +56,9 @@
"no-restricted-imports": ["error", {
"name": "electron",
"message": "This module does not provide the information about the process type. Please use 'electron/common', 'electron/main' or 'electron/renderer' instead."
}],
"import/no-unused-modules": ["error", {
"unusedExports": true
}]
}
}
6 changes: 3 additions & 3 deletions sources/code/common/modules/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ interface PersonObject {
url?: string;
}

export type PersonAny = string & PersonObject
export type PersonLike = string | PersonObject
type PersonAny = string & PersonObject
type PersonLike = string | PersonObject

export interface PackageJsonProperties {
interface PackageJsonProperties {
/** Node.js-friendly application name. */
name: string,
/** Node package description. */
Expand Down
2 changes: 1 addition & 1 deletion sources/code/main/modules/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const test = {} as unknown as ConfigElement;
if("radio" in test)
test.radio;

export interface AppConfigBase {
interface AppConfigBase {
settings: Record<string, Record<string, ConfigElement>>,
update: Record<string, unknown>
}
Expand Down
2 changes: 1 addition & 1 deletion sources/code/main/modules/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const cspKeysRegExp = new RegExp("(?<="+cspKeys.join("|")+")\\s+");

type cspObject = Partial<Record<(typeof cspKeys)[number],string>>;

export default class CSP {
class CSP {
private values: {
object: cspObject,
string: string
Expand Down
1 change: 1 addition & 0 deletions sources/code/renderer/modules/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-unused-modules */
/*
* A place to move useful WebCord's function that could be exposed to
* third-party addons in the future as part of planned "API".
Expand Down

0 comments on commit f0fc7f0

Please sign in to comment.