Skip to content

Commit 61e8862

Browse files
style: move linting to top level
1 parent 0140843 commit 61e8862

29 files changed

+427
-343
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/node_modules
2+
@uportal/*/dist
3+
@uportal/*/cjs
4+
@uportal/*/esm
5+
@uportal/*/umd
6+
@uportal/*/build

.gitignore

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,9 @@ $RECYCLE.BIN/
204204
yarn.lock
205205
.env.*
206206
!tsconfig.json
207-
@uportal/content-carousel/dist
208207
!@uportal/esco-content-menu/.env
209-
@uportal/esco-content-menu/dist
210-
@uportal/eyebrow-user-info/dist
211-
@uportal/open-id-connect/cjs
212-
@uportal/open-id-connect/esm
213-
@uportal/open-id-connect/umd
214-
@uportal/portlet-registry-to-array/cjs
215-
@uportal/portlet-registry-to-array/esm
216-
@uportal/portlet-registry-to-array/umd
217-
@uportal/waffle-menu/build
208+
@uportal/*/dist
209+
@uportal/*/cjs
210+
@uportal/*/esm
211+
@uportal/*/umd
212+
@uportal/*/build

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/node_modules
2+
@uportal/*/dist
3+
@uportal/*/cjs
4+
@uportal/*/esm
5+
@uportal/*/umd
6+
@uportal/*/build

.stylelintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/node_modules
2+
@uportal/*/dist
3+
@uportal/*/cjs
4+
@uportal/*/esm
5+
@uportal/*/umd
6+
@uportal/*/build

@uportal/content-carousel/src/components/ContentCarousel.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
width: 100%;
5151
position: absolute;
5252
bottom: 0;
53-
background: rgba(0,0,0,0.5);
53+
background: rgba(0, 0, 0, 0.5);
5454
color: white;
5555

5656
p {
@@ -71,5 +71,3 @@
7171
margin: 10px;
7272
}
7373
}
74-
75-

@uportal/content-carousel/src/components/ContentCarousel.ts

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,35 @@ import { PortletStrategy } from '@/lib/PortletStrategy';
1111
},
1212
})
1313
export default class ContentCarousel extends Vue {
14+
get height(): string {
15+
return this.carouselHeight;
16+
}
17+
18+
get alignText(): Object {
19+
return {
20+
textAlign: this.textAlign,
21+
};
22+
}
23+
24+
get isResponsiveToContainer(): boolean {
25+
return this.fitToContainer ? true : false;
26+
}
27+
28+
get computedItems(): CarouselItem[] {
29+
return this.strategy.items;
30+
}
31+
32+
get computedSlickOptions(): Object {
33+
const options =
34+
typeof this.slickOptions === 'string'
35+
? JSON.parse(this.slickOptions)
36+
: this.slickOptions;
37+
38+
// NOTE: in web component mode, jquery `$('')` goes haywire
39+
// this ensures vue slick will get a consistent reference to itself
40+
// NOTE: changing the swipe to slide default gives a better touch experience
41+
return { slick: this.$el || '', swipeToSlide: true, ...options };
42+
}
1443
@Prop([String])
1544
public type!: string;
1645

@@ -29,6 +58,10 @@ export default class ContentCarousel extends Vue {
2958
@Prop({ type: [String], default: 'left' })
3059
public textAlign?: string;
3160

61+
public strategy: DataStrategy = {
62+
items: [] as CarouselItem[],
63+
} as DataStrategy;
64+
3265
@Watch('computedItems')
3366
public onComputedItemsChange() {
3467
const slick: any = this.$refs.slick || {
@@ -46,10 +79,6 @@ export default class ContentCarousel extends Vue {
4679
});
4780
}
4881

49-
public strategy: DataStrategy = {
50-
items: [] as CarouselItem[],
51-
} as DataStrategy;
52-
5382
public mounted(): void {
5483
const list = Array.from(this.$el.getElementsByClassName('slick-list'));
5584
if (list.length > 0) {
@@ -75,34 +104,4 @@ export default class ContentCarousel extends Vue {
75104
}
76105
}
77106
}
78-
79-
get height(): string {
80-
return this.carouselHeight;
81-
}
82-
83-
get alignText(): Object {
84-
return {
85-
textAlign: this.textAlign,
86-
};
87-
}
88-
89-
get isResponsiveToContainer(): boolean {
90-
return this.fitToContainer ? true : false;
91-
}
92-
93-
get computedItems(): CarouselItem[] {
94-
return this.strategy.items;
95-
}
96-
97-
get computedSlickOptions(): Object {
98-
const options =
99-
typeof this.slickOptions === 'string'
100-
? JSON.parse(this.slickOptions)
101-
: this.slickOptions;
102-
103-
// NOTE: in web component mode, jquery `$('')` goes haywire
104-
// this ensures vue slick will get a consistent reference to itself
105-
// NOTE: changing the swipe to slide default gives a better touch experience
106-
return { slick: this.$el || '', swipeToSlide: true, ...options };
107-
}
108107
}

@uportal/content-carousel/tslint.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"exclude": ["node_modules/**"]
66
},
77
"rules": {
8-
"quotemark": [true, "single"],
9-
"indent": [true, "spaces", 2],
108
"interface-name": false,
119
"ordered-imports": false,
1210
"object-literal-sort-keys": false,

@uportal/esco-content-menu/src/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
<script>
99
//import ContentMenu from "./components/ContentMenu.vue"
10-
import HamburgerMenu from "./components/HamburgerMenu";
10+
import HamburgerMenu from './components/HamburgerMenu';
1111
1212
export default {
13-
name: "app",
13+
name: 'app',
1414
components: {
1515
//ContentMenu
16-
HamburgerMenu
17-
}
16+
HamburgerMenu,
17+
},
1818
};
1919
</script>
2020

@uportal/esco-content-menu/src/components/ActionFavorites.vue

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</template>
99

1010
<script>
11-
import oidc from "@uportal/open-id-connect";
12-
import i18n from "../i18n.js";
13-
import Icon from "vue-awesome/components/Icon";
14-
import "vue-awesome/icons/star";
15-
import "vue-awesome/icons/regular/star";
11+
import oidc from '@uportal/open-id-connect';
12+
import i18n from '../i18n.js';
13+
import Icon from 'vue-awesome/components/Icon';
14+
import 'vue-awesome/icons/star';
15+
import 'vue-awesome/icons/regular/star';
1616
1717
const checkStatus = function(response) {
1818
if (response.ok) {
@@ -29,30 +29,30 @@ const parseJSON = function(response) {
2929
};
3030
/*eslint no-console: ["error", { allow: ["warn", "error"] }] */
3131
export default {
32-
name: "ActionFavorites",
32+
name: 'ActionFavorites',
3333
props: {
3434
callOnToggleFav: Function,
3535
chanId: { type: String, required: true },
3636
favoriteApiUrl: {
3737
type: String,
3838
default:
3939
process.env.VUE_APP_PORTAL_CONTEXT +
40-
process.env.VUE_APP_FAVORITES_PORTLETS_URI
40+
process.env.VUE_APP_FAVORITES_PORTLETS_URI,
4141
},
4242
userInfoApiUrl: {
4343
type: String,
4444
default:
45-
process.env.VUE_APP_PORTAL_CONTEXT + process.env.VUE_APP_USER_INFO_URI
45+
process.env.VUE_APP_PORTAL_CONTEXT + process.env.VUE_APP_USER_INFO_URI,
4646
},
4747
fname: String,
48-
isFavorite: { type: Boolean, default: false }
48+
isFavorite: { type: Boolean, default: false },
4949
},
5050
components: {
51-
Icon
51+
Icon,
5252
},
5353
data() {
5454
return {
55-
favorite: this.isFavorite
55+
favorite: this.isFavorite,
5656
};
5757
},
5858
methods: {
@@ -61,7 +61,7 @@ export default {
6161
},
6262
toggleFavorite: function(event) {
6363
event.preventDefault();
64-
if (process.env.NODE_ENV !== "development") {
64+
if (process.env.NODE_ENV !== 'development') {
6565
if (this.favorite) {
6666
this.removeFromFavorite();
6767
} else {
@@ -74,58 +74,58 @@ export default {
7474
},
7575
changeFavoriteValue: function() {
7676
this.favorite = !this.favorite;
77-
this.$emit("is-favorite", this.favorite);
78-
if (typeof this.callOnToggleFav === "function") {
77+
this.$emit('is-favorite', this.favorite);
78+
if (typeof this.callOnToggleFav === 'function') {
7979
this.callOnToggleFav(this.favorite, this.fname);
8080
}
8181
},
8282
addToFavorite: function() {
8383
oidc({ userInfoApiUrl: this.userInfoApiUrl })
84-
.then(token => {
84+
.then((token) => {
8585
const options = {
86-
method: "POST",
87-
credentials: "same-origin",
86+
method: 'POST',
87+
credentials: 'same-origin',
8888
headers: {
89-
Authorization: "Bearer " + token.encoded,
90-
"Content-Type": "application/json"
91-
}
89+
Authorization: 'Bearer ' + token.encoded,
90+
'Content-Type': 'application/json',
91+
},
9292
};
9393
fetch(
9494
this.favoriteApiUrl +
95-
"?action=addFavorite&channelId=" +
95+
'?action=addFavorite&channelId=' +
9696
this.chanId,
9797
options
9898
)
9999
.then(checkStatus)
100100
.then(parseJSON)
101101
.then(this.changeFavoriteValue());
102102
})
103-
.catch(err => console.error("Error, with message:", err.statusText));
103+
.catch((err) => console.error('Error, with message:', err.statusText));
104104
},
105105
removeFromFavorite: function() {
106106
oidc({ userInfoApiUrl: this.userInfoApiUrl })
107-
.then(token => {
107+
.then((token) => {
108108
const options = {
109-
method: "POST",
110-
credentials: "same-origin",
109+
method: 'POST',
110+
credentials: 'same-origin',
111111
headers: {
112-
Authorization: "Bearer " + token.encoded,
113-
"Content-Type": "application/json"
114-
}
112+
Authorization: 'Bearer ' + token.encoded,
113+
'Content-Type': 'application/json',
114+
},
115115
};
116116
fetch(
117117
this.favoriteApiUrl +
118-
"?action=removeFavorite&channelId=" +
118+
'?action=removeFavorite&channelId=' +
119119
this.chanId,
120120
options
121121
)
122122
.then(checkStatus)
123123
.then(parseJSON)
124124
.then(this.changeFavoriteValue());
125125
})
126-
.catch(err => console.error("Error, with message:", err.statusText));
127-
}
128-
}
126+
.catch((err) => console.error('Error, with message:', err.statusText));
127+
},
128+
},
129129
};
130130
</script>
131131

0 commit comments

Comments
 (0)