Commit 8e579c37 authored by Ed Sanders's avatar Ed Sanders
Browse files

build: Update linters

Change-Id: Ie0983466ad0eed0a30d62f28b10efebd0f2eacba
parent 715d8ec0
Showing with 374 additions and 326 deletions
+374 -326
......@@ -17,7 +17,7 @@ module.exports = function ( grunt ) {
reportUnusedDisableDirectives: true
},
all: [
'**/*.js{,on}',
'**/*.{js,json}',
'!docs/**',
'!libs/**',
'!node_modules/**',
......@@ -25,12 +25,8 @@ module.exports = function ( grunt ) {
]
},
stylelint: {
options: {
syntax: 'less'
},
all: [
'**/*.css',
'**/*.less',
'**/*.{css,less}',
// TODO: Nested imports cause stylelint to crash
'!resources/skins.minerva.base.styles/print/styles.less',
'!docs/**',
......@@ -39,7 +35,9 @@ module.exports = function ( grunt ) {
'!vendor/**'
]
},
banana: conf.MessagesDirs,
banana: Object.assign( {
options: { requireLowerCase: false }
}, conf.MessagesDirs ),
watch: {
lint: {
files: [ '{resources,tests/qunit}/**/*.{js,less}' ],
......
This diff is collapsed.
......@@ -9,13 +9,13 @@
},
"dependencies": {},
"devDependencies": {
"eslint-config-wikimedia": "0.12.0",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"eslint-config-wikimedia": "0.14.1",
"grunt": "1.0.4",
"grunt-banana-checker": "0.8.1",
"grunt-contrib-watch": "1.1.0",
"grunt-eslint": "21.0.0",
"grunt-eslint": "22.0.0",
"grunt-notify": "0.4.5",
"grunt-stylelint": "0.10.1",
"grunt-stylelint": "0.11.1",
"jsdoc": "3.5.5",
"mwbot": "1.0.10",
"pre-commit": "1.2.2",
......
......@@ -76,6 +76,7 @@
*/
isOpen: function () {
// FIXME: We should be moving away from applying classes to the body
// eslint-disable-next-line no-jquery/no-class-state
return $( document.body ).hasClass( 'navigation-enabled' );
},
......@@ -104,7 +105,9 @@
this.closeNavigationDrawers();
drawerType = drawerType || 'primary';
// FIXME: We should be moving away from applying classes to the body
$( document.body ).toggleClass( 'navigation-enabled' )
// eslint-disable-next-line no-jquery/no-class-state
$( document.body )
.toggleClass( 'navigation-enabled' )
.toggleClass( drawerType + '-navigation-enabled' );
this.emit( 'open' );
......
......@@ -23,6 +23,7 @@ module.exports = function () {
if (
mainMenu &&
mainMenu.isOpen() &&
// eslint-disable-next-line no-jquery/no-class-state
!$target.hasClass( 'main-menu-button' )
) {
mainMenu.closeNavigationDrawers();
......
......@@ -112,6 +112,7 @@
*/
function init() {
$talk.on( 'click', function ( ev ) {
// eslint-disable-next-line no-jquery/no-class-state
if ( $talk.hasClass( 'add' ) ) {
window.location.hash = '#/talk/new';
} else {
......
......@@ -13,6 +13,7 @@
},
"rules": {
"camelcase": "off",
"prefer-template": "off",
"no-restricted-syntax": "off"
}
}
......@@ -34,12 +34,11 @@ class MinervaPage extends Page {
*/
setCookie( name, value ) {
const currentPage = browser.getUrl();
let cookie;
if ( !currentPage.includes( browser.options.baseUrl ) ) {
this.open();
}
cookie = browser.getCookie( name );
const cookie = browser.getCookie( name );
if ( !cookie || cookie.value !== value ) {
browser.setCookie( {
......
......@@ -29,7 +29,6 @@ describe( 'Menus open correct page for anonymous users', () => {
try {
iShouldSeeALinkInMenu( 'Nearby' );
} catch ( e ) {
// eslint-disable-next-line no-console
console.warn( 'Nearby item will only appear in main menu if $wgMFNearby is configured' );
}
} );
......
......@@ -86,7 +86,6 @@ exports.config = {
var filePath;
if ( !test.passed ) {
filePath = saveScreenshot( test.title );
// eslint-disable-next-line no-console
console.log( '\n\tScreenshot: ' + filePath + '\n' );
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment