Skip to content

Commit

Permalink
Pin resolution of postcss b/c 7<>8 incompatibilities; linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bjester committed May 23, 2024
1 parent ae1aa43 commit b6fa89f
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 41 deletions.
2 changes: 2 additions & 0 deletions docs/common/DocsAnchorTarget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
required: true,
validator(value) {
if (!value.startsWith('#')) {
// eslint-disable-next-line no-console
console.error(`'anchor' prop value '${value}' must start with a '#'`);
return false;
}
if (!value.match(/^#[\w\-.:]*$/)) {
// eslint-disable-next-line no-console
console.error(`'anchor' prop value '${value}' invalid`);
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions docs/common/DocsGithubLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
function validator(value) {
if (typeof value === 'string') {
if (value.startsWith('#')) {
// eslint-disable-next-line no-console
console.error(`PR or issue number '${value}' should not start with a '#'`);
return false;
}
if (!value.match(/^\d+$/)) {
// eslint-disable-next-line no-console
console.error(`PR or issue number '${value}' invalid`);
return false;
}
Expand Down Expand Up @@ -78,12 +80,14 @@
return `https://github.com/learningequality/kolibri-design-system/pull/${this.pull}`;
if (this.issue)
return `https://github.com/learningequality/kolibri-design-system/issues/${this.issue}`;
// eslint-disable-next-line no-console
console.error(`No URL, PR, or issue provided`);
return undefined;
},
},
mounted() {
if (this.pull && this.issue) {
// eslint-disable-next-line no-console
console.warn("Pass either 'pull' or 'issue', not both");
}
},
Expand Down
2 changes: 1 addition & 1 deletion docs/common/DocsPageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script>
const consola = require('consola');
import consola from 'consola';
export default {
name: 'DocsPageSection',
Expand Down
2 changes: 2 additions & 0 deletions jest.conf/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'regenerator-runtime/runtime';
import '@testing-library/jest-dom';
import * as Aphrodite from 'aphrodite';
import * as AphroditeNoImportant from 'aphrodite/no-important';

// eslint-disable-next-line import/no-unresolved
import 'mock-match-media/jest-setup';

import Vue from 'vue';
Expand Down
1 change: 1 addition & 0 deletions lib/KIcon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
},
mounted() {
if (KolibriIcons[this.icon].fixedColor && this.color) {
// eslint-disable-next-line no-console
console.error(
`KIcon: ${this.icon} color property will not be applied because the icon has a fixed color.`
);
Expand Down
1 change: 1 addition & 0 deletions lib/KImg/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
if (this.$listeners && this.$listeners.error) {
this.$emit('error', event);
} else {
// eslint-disable-next-line no-console
console.error(event);
}
},
Expand Down
3 changes: 3 additions & 0 deletions lib/KModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
validator(val) {
if (typeof val === 'string') {
if (!SIZE_STRINGS.includes(val)) {
// eslint-disable-next-line no-console
console.error(`'${val}' is not one of: ${SIZE_STRINGS}`);
return false;
}
Expand Down Expand Up @@ -234,11 +235,13 @@
},
created() {
if (this.$props.cancelText && !this.$listeners.cancel) {
// eslint-disable-next-line no-console
console.error(
'A "cancelText" has been set, but there is no "cancel" listener. The "cancel" button may not work correctly.'
);
}
if (this.$props.submitText && !this.$listeners.submit) {
// eslint-disable-next-line no-console
console.error(
'A "submitText" has been set, but there is no "submit" listener. The "submit" button may not work correctly.'
);
Expand Down
2 changes: 2 additions & 0 deletions lib/KRadioButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@
},
mounted() {
if (this.buttonValue === null && this.value === null) {
// eslint-disable-next-line no-console
console.error('KRadioButton: buttonValue prop is required');
}
if (this.buttonValue === null) {
// eslint-disable-next-line no-console
console.warn(
"KRadioButton: 'value' prop is deprecated and will be removed in a future release. Please use 'buttonValue' instead."
);
Expand Down
1 change: 1 addition & 0 deletions lib/KResponsiveWindowMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default {
},
mounted() {
// prettier-ignore
// eslint-disable-next-line no-console
console.warn(`Please use 'useKResponsiveWindow' composable instead of 'KResponsiveWindow' mixin`);
addWindowListener(this._updateWindow);
},
Expand Down
1 change: 1 addition & 0 deletions lib/grids/KFixedGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
required: true,
validator(value) {
if (value < 2 || value > 12) {
// eslint-disable-next-line no-console
console.error(`Number of columns (${value}) must be between 2 and 12`);
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/grids/KFixedGridItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@
},
validInputs() {
if (!this.gridMetrics || !this.gridMetrics.numCols || !this.gridMetrics.gutterWidth) {
// eslint-disable-next-line no-console
console.error('Grid metrics were not provided by parent');
return false;
}
if (this.computedSpan > this.gridMetrics.numCols) {
// eslint-disable-next-line no-console
console.error(
`Item span (${this.computedSpan}) is larger than grid size (${this.gridMetrics.numCols})`
);
Expand Down
1 change: 1 addition & 0 deletions lib/grids/KGridItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
const allowed = ['span', 'alignment'];
for (const key in obj) {
if (!allowed.includes(key)) {
// eslint-disable-next-line no-console
console.error(`Unexpected layout object property: '${key}'`);
return false;
}
Expand Down
7 changes: 7 additions & 0 deletions lib/grids/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export function validateAlignment(value) {
if (!['right', 'center', 'left', 'auto'].includes(value)) {
// eslint-disable-next-line no-console
console.error(`If provided, alignment must be one of: 'left', 'right', 'center', or 'auto`);
return false;
}
Expand All @@ -8,15 +9,18 @@ export function validateAlignment(value) {

export function validateSpan(value) {
if (isNaN(value)) {
// eslint-disable-next-line no-console
console.error(`Span (${value}) must be a number`);
return false;
}
const size = parseInt(value);
if (size !== Number(value)) {
// eslint-disable-next-line no-console
console.error(`Span (${value}) must be an integer`);
return false;
}
if (size < 1 || size > 12) {
// eslint-disable-next-line no-console
console.error(`Span (${value}) must be between 1 and 12`);
return false;
}
Expand All @@ -25,15 +29,18 @@ export function validateSpan(value) {

export function validateGutter(value) {
if (isNaN(value)) {
// eslint-disable-next-line no-console
console.error(`Gutter (${value}) must be an integer`);
return false;
}
const size = parseInt(value);
if (size !== Number(value)) {
// eslint-disable-next-line no-console
console.error(`Gutter (${value}) must be an integer`);
return false;
}
if (size % 2) {
// eslint-disable-next-line no-console
console.error(`Gutter (${value}) must be divisible by 2`);
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/loaders/KCircularLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
animation-delay: 1s;
}
@keyframes fadeIn {
@keyframes fade-in {
from {
opacity: 0;
}
Expand All @@ -233,7 +233,7 @@
.ui-progress-circular {
position: relative;
margin: 0 auto;
animation: fadeIn;
animation: fade-in;
animation-fill-mode: backwards;
animation-duration: 0s;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/loaders/KLinearLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
animation-delay: 1s;
}
@keyframes fadeIn {
@keyframes fade-in {
from {
opacity: 0;
}
Expand All @@ -130,7 +130,7 @@
transition-timing-function: ease;
transition-duration: 0.3s;
transition-property: height, opacity;
animation: fadeIn;
animation: fade-in;
animation-duration: 0s;
animation-fill-mode: backwards;
}
Expand Down
1 change: 1 addition & 0 deletions lib/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function generateTokenToColorMapping() {
throwThemeError(tokenName, mapString);
}
if (!HEX_COLOR_PATTERN.test(obj)) {
// eslint-disable-next-line no-console
console.warn(`Theme issue: Unexpected value '${obj}' for token '${tokenName}'`);
}
// if we end up at a valid string, use it
Expand Down
5 changes: 1 addition & 4 deletions lib/tabs/__tests__/KTabs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ const TABS_WITH_ROUTES = [
// spec files where majority of tabs functionality is tested.
describe(`KTabs`, () => {
it(`smoke test`, () => {
// stop custom validators from complaining for the smoke test
jest.spyOn(console, 'error').mockImplementation(() => {});
const wrapper = shallowMount(KTabs);
const wrapper = shallowMount(KTabs, { listeners: { error: () => {}}});
expect(wrapper.exists()).toBeTruthy();
console.error.mockRestore();
});

it(`binds all relevant props and 'activeTabId' to 'KTabsList'`, async () => {
Expand Down
3 changes: 3 additions & 0 deletions lib/tabs/tabsMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export default {
required: true,
validator: value => {
if (!value.length) {
// eslint-disable-next-line no-console
console.error('There are no tabs defined');
return false;
}
const isValidTab = tab => tab.id !== undefined && tab.label !== undefined;
const areAllTabsValid = value.every(isValidTab);
if (!areAllTabsValid) {
// eslint-disable-next-line no-console
console.error(`All tabs are required to have 'id' and 'label' properties defined`);
return false;
}
Expand Down Expand Up @@ -129,6 +131,7 @@ export default {
if (this.$listeners && this.$listeners.error) {
this.$emit('error', e);
} else {
// eslint-disable-next-line no-console
console.error(e);
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/utils/focusManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
export function getFirstFocusableChild(parent) {
if (!parent) {
// eslint-disable-next-line no-console
console.error(`[getFirstFocusableChild] 'parent' parameter is required`);
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"dev": "npm-run-all --parallel dev-only _lint-watch-fix _api-watch pregenerate",
"generate": "yarn run pregenerate && nuxt generate",
"lint": "kolibri-tools lint --pattern '**/*.{js,vue,scss,less,css}' -i ,'**/node_modules/**','**/.nuxt/**','**/dist/**','**/lib/KIcon/precompiled-icons/**','**/lib/keen/**','**/docs/environment.js','**/docs/jsdocs.js'",
"lint": "kolibri-tools lint --pattern '**/*.{js,vue,scss,less,css}' --ignore '**/node_modules/**,**/.nuxt/**,**/dist/**,**/lib/KIcon/precompiled-icons/**,**/lib/keen/**,**/docs/environment.js,**/docs/jsdocs.js'",
"lint-fix": "yarn lint -w",
"lint-watch": "yarn lint -m",
"pregenerate": "node utils/pregenerate.js",
Expand Down Expand Up @@ -74,6 +74,7 @@
},
"resolutions": {
"@babel/preset-env": "7.14.1",
"postcss": "8.4.38",
"postcss-loader": "3.0.0",
"css-loader": "4.3.0",
"vue": "2.6.14",
Expand Down
32 changes: 1 addition & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11256,25 +11256,7 @@ postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1:
indexes-of "^1.0.1"
uniq "^1.0.1"

postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6:
version "7.0.36"
resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz"
integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==
dependencies:
chalk "^2.4.2"
source-map "^0.6.1"
supports-color "^6.1.0"

postcss@^8.1.10:
version "8.3.6"
resolved "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz"
integrity sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==
dependencies:
colorette "^1.2.2"
nanoid "^3.1.23"
source-map-js "^0.6.2"

postcss@^8.2.14, postcss@^8.4.16, postcss@^8.4.21, postcss@^8.4.32, postcss@^8.4.33:
[email protected], postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6, postcss@^8.1.10, postcss@^8.2.14, postcss@^8.4.16, postcss@^8.4.21, postcss@^8.4.32, postcss@^8.4.33:
version "8.4.38"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e"
integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==
Expand Down Expand Up @@ -12632,11 +12614,6 @@ source-list-map@^2.0.0:
resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz"
integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==

source-map-js@^0.6.2:
version "0.6.2"
resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz"
integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==

source-map-js@^1.0.1, source-map-js@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af"
Expand Down Expand Up @@ -13213,13 +13190,6 @@ supports-color@^5.3.0:
dependencies:
has-flag "^3.0.0"

supports-color@^6.1.0:
version "6.1.0"
resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz"
integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==
dependencies:
has-flag "^3.0.0"

supports-color@^7.0.0, supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz"
Expand Down

0 comments on commit b6fa89f

Please sign in to comment.