Skip to content

Commit

Permalink
eslint: Only apply client rules to client files
Browse files Browse the repository at this point in the history
Change-Id: I757b9616ce69b6020e9f0e556e006d39de59eb01
  • Loading branch information
edg2s authored and Krinkle committed Feb 9, 2022
1 parent 44c9191 commit 9e234e6
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 25 deletions.
12 changes: 2 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery",
"wikimedia/mediawiki",
"wikimedia/jsduck"
"wikimedia/server"
],
"globals": {
"require": "readonly",
"module": "readonly"
},
"rules": {
"max-len": "off",
"no-jquery/no-global-selector": "off"
"max-len": "warn"
}
}
7 changes: 4 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-env node */
'use strict';

module.exports = function ( grunt ) {
var wgServer = process.env.MW_SERVER,
const wgServer = process.env.MW_SERVER,
wgScriptPath = process.env.MW_SCRIPT_PATH,
karmaProxy = {};

Expand Down Expand Up @@ -98,7 +99,7 @@ module.exports = function ( grunt ) {
} );

grunt.registerTask( 'assert-mw-env', function () {
var ok = true;
let ok = true;
if ( !process.env.MW_SERVER ) {
grunt.log.error( 'Environment variable MW_SERVER must be set.\n' +
'Set this like $wgServer, e.g. "http://localhost"'
Expand Down
5 changes: 5 additions & 0 deletions maintenance/jsduck/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"wikimedia/jsduck"
]
}
5 changes: 5 additions & 0 deletions mw-config/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"../resources/src/.eslintrc.json"
]
}
17 changes: 17 additions & 0 deletions resources/src/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery",
"wikimedia/mediawiki",
"wikimedia/jsduck"
],
"globals": {
"require": "readonly",
"module": "readonly"
},
"rules": {
"max-len": "off",
"no-jquery/no-global-selector": "off"
}
}
8 changes: 0 additions & 8 deletions tests/.eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions tests/api-testing/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"root": true,
"extends": [
"wikimedia/server",
"wikimedia/mocha"
],
"rules": {
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/data/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": [
"../../../resources/src/.eslintrc.json"
],
"rules": {
"array-bracket-spacing": "off",
"comma-spacing": "off",
Expand Down
10 changes: 6 additions & 4 deletions tests/qunit/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"root": true,
"extends": [
"wikimedia/qunit",
"../../.eslintrc.json"
"../../resources/src/.eslintrc.json",
"wikimedia/qunit"
],
"globals": {
"sinon": "readonly"
},
"rules": {
"qunit/resolve-async": "off",
"no-jquery/no-parse-html-literal": "off"
"compat/compat": [ "error", "last 2 chrome versions, last 2 firefox versions" ],
"no-jquery/no-parse-html-literal": "off",
"qunit/resolve-async": "off"
}
}

0 comments on commit 9e234e6

Please sign in to comment.