Skip to content

Commit edb67ad

Browse files
fix: lint adjustments
1 parent 49b836e commit edb67ad

File tree

9 files changed

+27
-21
lines changed

9 files changed

+27
-21
lines changed

packages/angular/angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"build": {
1313
"builder": "@angular-devkit/build-angular:ng-packagr",
1414
"options": {
15-
"tsConfig": "projects/cloudinary-library/tsconfig.lib.json",
15+
"tsConfig": "projects/cloudinary-library/tsconfig.lib.prod.json",
1616
"project": "projects/cloudinary-library/ng-package.json"
1717
},
1818
"configurations": {
@@ -33,7 +33,7 @@
3333
"builder": "@angular-devkit/build-angular:tslint",
3434
"options": {
3535
"tsConfig": [
36-
"projects/cloudinary-library/tsconfig.lib.json",
36+
"projects/cloudinary-library/tsconfig.lib.prod.json",
3737
"projects/cloudinary-library/tsconfig.spec.json"
3838
],
3939
"exclude": [

packages/angular/projects/cloudinary-library/src/testUtils/dispatchResize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { tick } from '@angular/core/testing';
66
* @param fixture {any} The current fixture
77
* @param time {number} The timout
88
*/
9-
export function dispatchResize(width: string, fixture: any, time: number){
9+
export function dispatchResize(width: string, fixture: any, time: number) {
1010
document.body.style.width = width;
1111
window.dispatchEvent(new Event('resize'));
1212
fixture.detectChanges();

packages/angular/projects/cloudinary-library/src/tests/cloudinary-image.component.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('CloudinaryImageComponent render', () => {
2222
tick(0);
2323
const imgElement: HTMLImageElement = fixture.nativeElement;
2424
const img = imgElement.querySelector('img');
25-
expect(img.src).toBe('https://res.cloudinary.com/demo/image/upload/sample')
25+
expect(img.src).toBe('https://res.cloudinary.com/demo/image/upload/sample');
2626
}));
2727

2828
it('ngOnChanges should trigger plugin rerun', fakeAsync(() => {
@@ -54,17 +54,17 @@ describe('CloudinaryImageComponent render', () => {
5454
const img = imgElement.querySelector('img');
5555
expect(img.outerHTML).toBe('<img _ngcontent-a-c11="" alt="text text text" width="400px" height="500px"' +
5656
' loading="eager" src="https://res.cloudinary.com/demo/image/upload/sample">');
57-
component.width = "800px";
58-
component.alt = "updated alt text";
59-
component.height = "1000px";
60-
component.loading = "lazy";
57+
component.width = '800px';
58+
component.alt = 'updated alt text';
59+
component.height = '1000px';
60+
component.loading = 'lazy';
6161
component.ngOnChanges();
6262
expect(img.outerHTML).toBe('<img _ngcontent-a-c11="" alt="updated alt text" width="800px" height="1000px"' +
6363
' loading="lazy" src="https://res.cloudinary.com/demo/image/upload/sample">');
6464
component.width = undefined;
6565
component.height = undefined;
66-
component.alt = "";
67-
component.loading = "lazy";
66+
component.alt = '';
67+
component.loading = 'lazy';
6868
component.ngOnChanges();
6969
expect(img.outerHTML).toBe('<img _ngcontent-a-c11="" alt=""' +
7070
' loading="lazy" src="https://res.cloudinary.com/demo/image/upload/sample">');

packages/angular/projects/cloudinary-library/src/tests/cloudinary-video.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { CloudinaryVideoComponent } from '../lib/cloudinary-video.component';
33
import {CloudinaryImage, CloudinaryVideo} from '@cloudinary/url-gen';
44
import { auto, vp9, theora } from '@cloudinary/url-gen/qualifiers/videoCodec';
55
import { videoCodec } from '@cloudinary/url-gen/actions/transcode';
6-
import {ElementRef} from "@angular/core";
6+
import {ElementRef} from '@angular/core';
77

88
const cloudinaryImage = new CloudinaryImage('sample', { cloudName: 'demo' }, { analytics: false });
99
const cloudinaryVideo = new CloudinaryVideo('sample', { cloudName: 'demo'}, { analytics: false });
@@ -138,12 +138,12 @@ describe('CloudinaryVideoComponent render', () => {
138138

139139
it('should contain poster when "auto" is passed as cldPoster', fakeAsync(() => {
140140
component.cldVid = new CloudinaryVideo('sample', { cloudName: 'demo'}, { analytics: false });
141-
component.cldPoster = "auto";
141+
component.cldPoster = 'auto';
142142
const vidElement: HTMLVideoElement = fixture.nativeElement;
143143
const video = vidElement.querySelector('video');
144144
fixture.detectChanges();
145145
tick(0);
146-
146+
147147
expect(video.attributes.getNamedItem('poster').value)
148148
.toEqual( 'https://res.cloudinary.com/demo/video/upload/q_auto/f_jpg/so_auto/sample');
149149
}));
@@ -155,7 +155,7 @@ describe('CloudinaryVideoComponent render', () => {
155155
const video = vidElement.querySelector('video');
156156
fixture.detectChanges();
157157
tick(0);
158-
158+
159159
expect(video.attributes.getNamedItem('poster').value)
160160
.toEqual( 'https://res.cloudinary.com/demo/image/upload/sample');
161161
}));

packages/angular/tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"use-input-property-decorator": true,
121121
"use-output-property-decorator": true,
122122
"use-host-property-decorator": true,
123-
"no-input-rename": true,
123+
"no-input-rename": false,
124124
"no-output-rename": true,
125125
"use-life-cycle-interface": true,
126126
"use-pipe-transform-interface": true,

packages/vue/src/components/AdvancedImage.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
* },
4747
* });
4848
* </ script>
49-
*
49+
*
5050
* @example
5151
* <caption>
5252
* Using `AdvancedVideo` custom defined resources.
5353
* </caption>
54-
*
54+
*
5555
* // AdvancedVideo
5656
* <template>
5757
* <AdvancedVideo :cldVid="cldVid" :sources="sources" controls width="600" />
@@ -103,6 +103,7 @@
103103
* @vue-prop {CloudinaryImage} cldImg Generated by @cloudinary/url-gen
104104
* @vue-prop {Plugins} plugins Advanced image component plugins accessibility(), responsive(), lazyload(), placeholder()
105105
*/
106+
// eslint-disable-next-line prettier/prettier
106107
</script>
107108

108109
<script setup lang="ts">

packages/vue/src/components/AdvancedVideo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @memberOf VueSDK
88
* @module AdvancedVideo
99
* @description The Cloudinary video component.
10-
*
10+
*
1111
* @vue-prop {CloudinaryVideo} cldVid Generated by @cloudinary/url-gen
1212
* @vue-prop {VideoPoster} cldPoster Generated by @cloudinary/url-gen
1313
* @vue-prop {Plugins} plugins Advanced video component plugins accessibility(), responsive(), lazyload(), placeholder()

packages/vue/tests/unit/placeholder.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@ import { sepia } from "@cloudinary/url-gen/actions/effect";
55
import { mount } from "@vue/test-utils";
66
import { waitTicks } from "./utils";
77

8+
// eslint-disable-next-line @typescript-eslint/no-empty-function
9+
const noop = () => {};
10+
811
describe("placeholder", () => {
912
let cloudinaryImage: CloudinaryImage;
1013

1114
const mockImage = {
1215
src: null,
13-
onload: () => {},
14-
onerror: () => {},
16+
onload: noop,
17+
onerror: noop,
1518
};
1619
beforeEach(() => {
20+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1721
// @ts-ignore
1822
window.Image = function () {
1923
return mockImage;
@@ -124,6 +128,7 @@ describe("placeholder", () => {
124128
const component = mount(AdvancedImage, {
125129
props: { cldImg: cloudinaryImage, plugins: [placeholder()] },
126130
});
131+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
127132
// @ts-ignore
128133
component.element.onload(); // simulate element onload
129134
mockImage.onerror(); // simulate image onerror

packages/vue/tests/unit/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const waitTicks = async (ticks: number) => {
2020
* @param args
2121
*/
2222
export const testIf = (condition: boolean, ...args: [string, () => void]) =>
23-
condition ? test(...args) : {};
23+
condition ? test(...args) : {};
2424

2525
export const setAnalyticsConstants = () => {
2626
SDKAnalyticsConstants.sdkSemver = "1.0.0";

0 commit comments

Comments
 (0)