From 1aec6764ad6338c264bc7c4e2e1f2566829c1872 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 4 Sep 2023 18:13:32 +0100 Subject: [PATCH] build: Use wikimedia/server for root folder eslint config Change-Id: I8b6938f2ac935724cf80e01096591e6a4c0cbbe0 --- .eslintrc.json | 40 ++------------------------------------ .svgo.config.js | 2 ++ jest.config.js | 2 ++ jest.setup.js | 3 ++- resources/.eslintrc.json | 42 ++++++++++++++++++++++++++++++++++++++++ tests/.eslintrc.json | 2 +- 6 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 resources/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json index e3573f02b..04f9da7ac 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,42 +1,6 @@ { "root": true, - "plugins": [ - "no-jquery" - ], "extends": [ - "plugin:no-jquery/all", - "wikimedia/client-es6", - "wikimedia/jquery", - "wikimedia/mediawiki" - ], - "env": { - "browser": true - }, - "globals": { - "exports": true - }, - "parserOptions": { - "sourceType": "module" - }, - "settings": {}, - "rules": { - "no-jquery/no-other-utils": "error", - "no-jquery/no-trigger": "error", - "no-jquery/no-jquery-constructor": "error", - "no-jquery/no-find-collection": "error", - "no-jquery/no-attr": "error", - "no-jquery/no-class": "error", - "no-jquery/no-text": "error", - "no-jquery/no-css": "error", - "no-jquery/no-other-methods": "error", - "no-jquery/no-html": "error", - "no-jquery/no-class-state": "error", - "no-jquery/no-deferred": "error", - "no-jquery/no-when": "error", - "no-jquery/no-extend": "error", - "mediawiki/no-nodelist-unsupported-methods": "off", - "jsdoc/no-undefined-types": "off", - "compat/compat": "off", - "mediawiki/class-doc": "off" - } + "wikimedia/server" + ] } diff --git a/.svgo.config.js b/.svgo.config.js index db1adb262..c2744f7bb 100644 --- a/.svgo.config.js +++ b/.svgo.config.js @@ -1,3 +1,5 @@ +'use strict'; + /** * SVGO Configuration * Compatible to v3.0.0+ diff --git a/jest.config.js b/jest.config.js index 0ebaf934b..572ffae4b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,5 @@ +'use strict'; + // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html diff --git a/jest.setup.js b/jest.setup.js index a35eb7663..b267217c6 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -1,4 +1,5 @@ -/* global global */ +'use strict'; + const mockMediaWiki = require( '@wikimedia/mw-node-qunit/src/mockMediaWiki.js' ); global.mw = mockMediaWiki(); global.$ = require( 'jquery' ); diff --git a/resources/.eslintrc.json b/resources/.eslintrc.json new file mode 100644 index 000000000..e3573f02b --- /dev/null +++ b/resources/.eslintrc.json @@ -0,0 +1,42 @@ +{ + "root": true, + "plugins": [ + "no-jquery" + ], + "extends": [ + "plugin:no-jquery/all", + "wikimedia/client-es6", + "wikimedia/jquery", + "wikimedia/mediawiki" + ], + "env": { + "browser": true + }, + "globals": { + "exports": true + }, + "parserOptions": { + "sourceType": "module" + }, + "settings": {}, + "rules": { + "no-jquery/no-other-utils": "error", + "no-jquery/no-trigger": "error", + "no-jquery/no-jquery-constructor": "error", + "no-jquery/no-find-collection": "error", + "no-jquery/no-attr": "error", + "no-jquery/no-class": "error", + "no-jquery/no-text": "error", + "no-jquery/no-css": "error", + "no-jquery/no-other-methods": "error", + "no-jquery/no-html": "error", + "no-jquery/no-class-state": "error", + "no-jquery/no-deferred": "error", + "no-jquery/no-when": "error", + "no-jquery/no-extend": "error", + "mediawiki/no-nodelist-unsupported-methods": "off", + "jsdoc/no-undefined-types": "off", + "compat/compat": "off", + "mediawiki/class-doc": "off" + } +} diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json index 50031f57c..72ea5c6a6 100644 --- a/tests/.eslintrc.json +++ b/tests/.eslintrc.json @@ -1,7 +1,7 @@ { "root": true, "extends": [ - "../.eslintrc.json" + "../resources/.eslintrc" ], "parserOptions": { "ecmaVersion": 2018