From 331a935902e509c58e92228bc78fdece9bf633d7 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 2 Nov 2021 13:04:29 +0200 Subject: [PATCH] Move ESLint config to an override --- .eslintrc.json | 19 ++++++++++++++----- js/tests/integration/bundle-modularity.js | 1 - js/tests/integration/bundle.js | 1 - 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 123212f4a7..7ec5ba9e38 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,8 @@ { "root": true, - "plugins": ["ssr-friendly"], "extends": [ "plugin:import/errors", "plugin:import/warnings", - "plugin:ssr-friendly/recommended", "plugin:unicorn/recommended", "xo", "xo/browser" @@ -52,8 +50,6 @@ "error", "never" ], - "ssr-friendly/no-dom-globals-in-react-cc-render": "off", - "ssr-friendly/no-dom-globals-in-react-fc": "off", "unicorn/explicit-length-check": "off", "unicorn/no-array-callback-reference": "off", "unicorn/no-array-method-this-argument": "off", @@ -65,5 +61,18 @@ "unicorn/prefer-query-selector": "off", "unicorn/prefer-spread": "off", "unicorn/prevent-abbreviations": "off" - } + }, + "overrides": [ + { + "files": "js/src/**/*.js", + "plugins": ["ssr-friendly"], + "extends": [ + "plugin:ssr-friendly/recommended" + ], + "rules": { + "ssr-friendly/no-dom-globals-in-react-cc-render": "off", + "ssr-friendly/no-dom-globals-in-react-fc": "off" + } + } + ] } diff --git a/js/tests/integration/bundle-modularity.js b/js/tests/integration/bundle-modularity.js index ecfd2335f9..8546141b19 100644 --- a/js/tests/integration/bundle-modularity.js +++ b/js/tests/integration/bundle-modularity.js @@ -1,7 +1,6 @@ import Tooltip from '../../dist/tooltip' import '../../dist/carousel' -// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope window.addEventListener('load', () => { [].concat(...document.querySelectorAll('[data-bs-toggle="tooltip"]')) .map(tooltipNode => new Tooltip(tooltipNode)) diff --git a/js/tests/integration/bundle.js b/js/tests/integration/bundle.js index 8c5442626d..452088a7d8 100644 --- a/js/tests/integration/bundle.js +++ b/js/tests/integration/bundle.js @@ -1,6 +1,5 @@ import { Tooltip } from '../../../dist/js/bootstrap.esm.js' -// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope window.addEventListener('load', () => { [].concat(...document.querySelectorAll('[data-bs-toggle="tooltip"]')) .map(tooltipNode => new Tooltip(tooltipNode))