Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run eslint --fix, set @typescript-eslint/no-explicit-any to warn #456

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
root: true,
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
curly: 'error',
Expand Down
1 change: 0 additions & 1 deletion src/components/castDevices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let deviceId: number | null = null;
/**
* Get device id of the active Cast device.
* Tries to identify the active Cast device by testing support for different codecs.
*
* @returns Active Cast device Id.
*/
export function getActiveDeviceId(): number {
Expand Down
21 changes: 0 additions & 21 deletions src/components/codecSupportHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const castContext = cast.framework.CastReceiverContext.getInstance();
* depends on the manual setting.
*
* Currently it's disabled because of problems getting it to work with HLS.
*
* @returns true if E-AC-3 can be played
*/
export function hasEAC3Support(): boolean {
Expand All @@ -24,9 +23,7 @@ export function hasEAC3Support(): boolean {
* depends on the manual setting.
*
* Currently it's disabled because of problems getting it to work with HLS.
*
* @returns true if AC-3 can be played
*
*/
export function hasAC3Support(): boolean {
//return castContext.canDisplayType('audio/mp4', 'ac-3');
Expand All @@ -40,7 +37,6 @@ export function hasAC3Support(): boolean {
* will mostly support 6ch pcm, and if any generation of cast devices
* is actually capable of decoding e.g. aac 6ch, we can return true here
* and give it a shot.
*
* @returns true if surround codecs can be played
*/
export function hasSurroundSupport(): boolean {
Expand All @@ -50,7 +46,6 @@ export function hasSurroundSupport(): boolean {

/**
* Check if this device can play HEVC content.
*
* @returns true if HEVC is supported
*/
export function hasH265Support(): boolean {
Expand All @@ -61,7 +56,6 @@ export function hasH265Support(): boolean {
* Check if this device can play text tracks.
* This is not supported on Chromecast Audio,
* but otherwise is.
*
* @param deviceId - the device id
* @returns true if text tracks are supported
*/
Expand All @@ -71,7 +65,6 @@ export function hasTextTrackSupport(deviceId: number): boolean {

/**
* Check if this device can play VP-8 content.
*
* @returns true if VP-8 is supported
*/
export function hasVP8Support(): boolean {
Expand All @@ -80,7 +73,6 @@ export function hasVP8Support(): boolean {

/**
* Check if this device can play VP-9 content.
*
* @returns true if VP-9 is supported
*/
export function hasVP9Support(): boolean {
Expand All @@ -89,7 +81,6 @@ export function hasVP9Support(): boolean {

/**
* Get the max supported media bitrate for the active Cast device.
*
* @returns Max supported bitrate.
*/
export function getMaxBitrateSupport(): number {
Expand All @@ -101,7 +92,6 @@ export function getMaxBitrateSupport(): number {

/**
* Get the max supported video width the active Cast device supports.
*
* @param deviceId - Cast device id.
* @returns Max supported width.
*/
Expand All @@ -122,7 +112,6 @@ export function getMaxWidthSupport(deviceId: number): number {

/**
* Get all H.264 profiles supported by the active Cast device.
*
* @param deviceId - Cast device id.
* @returns All supported H.264 profiles.
*/
Expand All @@ -139,7 +128,6 @@ export function getH264ProfileSupport(deviceId: number): string {

/**
* Get the highest H.264 level supported by the active Cast device.
*
* @param deviceId - Cast device id.
* @returns The highest supported H.264 level.
*/
Expand All @@ -160,7 +148,6 @@ export function getH264LevelSupport(deviceId: number): number {

/**
* Get all H.265 profiles supported by the active Cast device.
*
* @param deviceId - Cast device id.
* @returns All supported H.265 profiles.
*/
Expand All @@ -175,7 +162,6 @@ export function getH265ProfileSupport(deviceId: number): string {

/**
* Get the highest H.265 level supported by the active Cast device.
*
* @param deviceId - Cast device id.
* @returns The highest supported H.265 level.
*/
Expand All @@ -189,7 +175,6 @@ export function getH265LevelSupport(deviceId: number): number {

/**
* Get VPX (VP8, VP9) codecs supported by the active Cast device.
*
* @returns Supported VPX codecs.
*/
export function getSupportedVPXVideoCodecs(): Array<string> {
Expand All @@ -208,7 +193,6 @@ export function getSupportedVPXVideoCodecs(): Array<string> {

/**
* Get supported video codecs suitable for use in an MP4 container.
*
* @returns Supported MP4 video codecs.
*/
export function getSupportedMP4VideoCodecs(): Array<string> {
Expand All @@ -224,7 +208,6 @@ export function getSupportedMP4VideoCodecs(): Array<string> {

/**
* Get supported audio codecs suitable for use in an MP4 container.
*
* @returns Supported MP4 audio codecs.
*/
export function getSupportedMP4AudioCodecs(): Array<string> {
Expand All @@ -246,7 +229,6 @@ export function getSupportedMP4AudioCodecs(): Array<string> {

/**
* Get supported video codecs suitable for use with HLS.
*
* @returns Supported HLS video codecs.
*/
export function getSupportedHLSVideoCodecs(): Array<string> {
Expand All @@ -257,7 +239,6 @@ export function getSupportedHLSVideoCodecs(): Array<string> {

/**
* Get supported audio codecs suitable for use with HLS.
*
* @returns All supported HLS audio codecs.
*/
export function getSupportedHLSAudioCodecs(): Array<string> {
Expand All @@ -267,7 +248,6 @@ export function getSupportedHLSAudioCodecs(): Array<string> {

/**
* Get supported audio codecs suitable for use in a WebM container.
*
* @returns All supported WebM audio codecs.
*/
export function getSupportedWebMAudioCodecs(): Array<string> {
Expand All @@ -276,7 +256,6 @@ export function getSupportedWebMAudioCodecs(): Array<string> {

/**
* Get supported audio codecs suitable for use in a WebM container.
*
* @returns All supported WebM audio codecs.
*/
export function getSupportedAudioCodecs(): Array<string> {
Expand Down
6 changes: 0 additions & 6 deletions src/components/credentialManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ interface CredentialStore {
export class credentialManager {
/**
* Store for credentials
*
* @private
*/
private credentialStore: CredentialStore;

/**
* Default constructor for credentialManager.
*
* @param initialStore - Existing CredentialStore to initialize private store with.
*/
constructor(initialStore: CredentialStore = {}) {
Expand All @@ -27,7 +25,6 @@ export class credentialManager {

/**
* Get credentials for the provided server ID.
*
* @param serverId - ID of the server the credentials belong to.
* @returns Credentials for the provided server ID.
* or undefined if the store has no server with that ID.
Expand All @@ -40,7 +37,6 @@ export class credentialManager {

/**
* Update credentials for the provided server ID.
*
* @param serverId - ID of the server to update.
* @param newCredentials - Updated Credentials.
* @returns True if the value was updated, false if it wasn't.
Expand All @@ -57,7 +53,6 @@ export class credentialManager {

/**
* Add a new credential to store. Only accepts new entries.
*
* @param serverId - ID of the server the credentials belong to.
* @param credentials - Credentials of the server.
* @returns True if server was added, false if it wasn't.
Expand All @@ -74,7 +69,6 @@ export class credentialManager {

/**
* Remove a credential from store.
*
* @param serverId - ID of the server the credentials belong to.
* @returns True if server was removed, false if it wasn't.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/components/deviceprofileBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ let currentDeviceId: number;
* @param Property - What property the condition should test.
* @param Condition - The condition to test the values for.
* @param Value - The value to compare against.
* @param [IsRequired=false] - Don't permit unknown values
* @param [IsRequired] - Don't permit unknown values
* @returns A profile condition created from the parameters.
*/
function createProfileCondition(
Expand Down Expand Up @@ -397,7 +397,6 @@ function getSubtitleProfiles(): Array<SubtitleProfile> {

/**
* Creates a device profile containing supported codecs for the active Cast device.
*
* @param options - Profile options
* @returns Device profile.
*/
Expand Down
Loading