build: Update linters and linter config

* Update stylelint-config-wikimedia to 0.13.0
* Ensure eslintrc.js and root files are linted
  with server config

Change-Id: I59c49fedd5b0c4c5620f960b78e4f781a6bc5abb
This commit is contained in:
Ed Sanders 2022-05-07 01:57:25 +01:00
parent 4519cd68f6
commit 86caa17713
16 changed files with 4806 additions and 6420 deletions

View file

@ -3,4 +3,3 @@
/node_modules/
/vendor/
/tests/resource-loader-bundlesize.js
.eslintrc.js

4
.eslintrc.json Normal file
View file

@ -0,0 +1,4 @@
{
"root": true,
"extends": "wikimedia/server"
}

1
.gitignore vendored
View file

@ -5,6 +5,7 @@
/composer.phar
.DS_Store
/.eslintcache
/.stylelintcache
/tests/selenium/log
/tmp
/.resolve-less-imports

View file

@ -1,10 +1,14 @@
{
"extends": "stylelint-config-wikimedia",
"extends": [
"stylelint-config-wikimedia/support-modern",
"stylelint-config-wikimedia/mediawiki"
],
"rules": {
"declaration-no-important": null,
"declaration-property-unit-disallowed-list": null,
"property-disallowed-list": "transition",
"selector-class-pattern": null,
"selector-list-comma-newline-after": null,
"value-keyword-case": null,
"declaration-property-unit-disallowed-list": null
"value-keyword-case": null
}
}

View file

@ -0,0 +1,4 @@
{
"root": true,
"extends": "../../../resources/.eslintrc.js"
}

View file

@ -3,11 +3,11 @@
@import 'minerva.variables.less';
.editor-textarea() {
// stylelint-disable-next-line no-descending-specificity
.box-sizing( border-box );
width: 100%;
// Note if a textarea has a .mw-ui-input class, this may be overridden
padding: 10px @contentPadding 10px @contentPadding;
// stylelint-disable-next-line plugin/no-unsupported-browser-features
resize: none;
}

11167
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,8 +7,8 @@
"build-storybook": "npm run storybook:setup && build-storybook -o docs/ui",
"lint": "npm -s run lint:styles && npm -s run lint:js && npm -s run lint:i18n",
"lint:fix": "npm -s run lint:styles -- --fix && npm -s run lint:js -- --fix && npm -s run lint:i18",
"lint:js": "eslint --cache '**/*.{js,json}'",
"lint:styles": "stylelint '**/*.{css,less}'",
"lint:js": "eslint --cache .",
"lint:styles": "stylelint --cache --report-needless-disables '**/*.{css,less}'",
"lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
"test": "npm run lint && npm run doc && dev-scripts/svg_check.sh",
"minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/",
@ -35,8 +35,9 @@
"less-loader": "4.1.0",
"mustache": "3.0.1",
"mwbot": "2.0.0",
"postcss-less": "6.0.0",
"pre-commit": "1.2.2",
"stylelint-config-wikimedia": "0.11.1",
"stylelint-config-wikimedia": "0.13.0",
"svgo": "2.8.0",
"wdio-mediawiki": "1.2.0",
"webdriverio": "7.19.5"

View file

@ -3,6 +3,9 @@
// The merge function calls Object.assign with special handling for configuration such as
// `no-restricted-properties` and `no-restricted-syntax` which are array based - ensuring the two
// values being merged are concatenated.
'use strict';
const merge = require( 'eslint-config-wikimedia/language/merge.js' ),
config = {
root: true,
@ -46,7 +49,14 @@ const merge = require( 'eslint-config-wikimedia/language/merge.js' ),
'no-use-before-define': 'off',
'no-underscore-dangle': 'off',
'jsdoc/no-undefined-types': 'off'
}
},
overrides: [ {
files: [ '.eslintrc.js' ],
extends: 'wikimedia/server',
rules: {
'compat/compat': 'off'
}
} ]
};
// eslint-disable-next-line es/no-object-assign

View file

@ -15,7 +15,6 @@
}
/* TODO: Fix specificity */
/* stylelint-disable-next-line no-descending-specificity */
.client-js .jsonly {
display: inherit;
}

View file

@ -12,6 +12,7 @@ body {
html {
font-size: @font-size-root;
// Support Safari: Prevent font scaling in landscape
// stylelint-disable-next-line plugin/no-unsupported-browser-features
-webkit-text-size-adjust: none;
}
@ -96,6 +97,7 @@ main {
background-repeat: no-repeat;
background-size: @size-icon-search;
// Support Safari: Get rid of rounded corners.
// stylelint-disable-next-line plugin/no-unsupported-browser-features
-webkit-appearance: none;
width: 100%;
margin-top: 0;

View file

@ -22,8 +22,10 @@
.minerva-talk-full-page-button {
display: block;
position: sticky;
// stylelint-disable-next-line plugin/no-unsupported-browser-features
position: -webkit-sticky;
// stylelint-disable-next-line plugin/no-unsupported-browser-features
position: sticky;
bottom: 0;
left: 0;
width: 100%;

View file

@ -24,8 +24,10 @@
// The large "Compare selected revisions" button container
.mw-history-compareselectedversions {
background: @background-color-base;
position: sticky;
// stylelint-disable-next-line plugin/no-unsupported-browser-features
position: -webkit-sticky;
// stylelint-disable-next-line plugin/no-unsupported-browser-features
position: sticky;
top: 0;
z-index: @z-indexAboveContent;
@ -35,6 +37,7 @@
.mw-ui-button-colors-primary( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
width: 100%;
max-width: 100%;
// stylelint-disable-next-line plugin/no-unsupported-browser-features
-webkit-appearance: unset;
font-weight: bold;
border-radius: @border-radius-base;

View file

@ -1,8 +1,8 @@
{
"root": true,
"extends": [
"wikimedia/qunit",
"../../.eslintrc.js"
"../../resources/.eslintrc.js",
"wikimedia/qunit"
],
"rules": {
"no-restricted-properties": "off",

View file

@ -9,6 +9,7 @@ const assert = require( 'assert' ),
const waitForPropagation = ( timeMs ) => {
// wait 2 seconds so the change can propogate.
// Replace this with a more dynamic statement.
// eslint-disable-next-line wdio/no-pause
browser.pause( timeMs );
};

View file

@ -26,6 +26,7 @@ describe( 'Search', () => {
iSeeTheSearchOverlay();
iTypeIntoTheSearchBox( 'Selenium search tes' );
// This pause statement is a temporary bandaid until we figure a bettery dynamic sync
// eslint-disable-next-line wdio/no-pause
browser.pause( 1000 );
iClickASearchWatchstar();
iShouldSeeAToastNotification();