diff --git a/.eslintrc.yml b/.eslintrc.yml index b6abb574e19c90951da5d8077602c400d82c8184..6b9a1ce62c07e771768dcdae2439f7c498d6e621 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -3,7 +3,7 @@ extends: - plugin:@gitlab/i18n - plugin:no-jquery/slim - plugin:no-jquery/deprecated-3.4 - - ./tooling/eslint-config/conditionally_ignore_ee.js + - ./tooling/eslint-config/conditionally_ignore.js globals: __webpack_public_path__: true gl: false diff --git a/tooling/eslint-config/conditionally_ignore.js b/tooling/eslint-config/conditionally_ignore.js new file mode 100644 index 0000000000000000000000000000000000000000..6132c1f52f4b2eafb77814cdc88f546e685aa502 --- /dev/null +++ b/tooling/eslint-config/conditionally_ignore.js @@ -0,0 +1,19 @@ +/* eslint-disable import/no-commonjs */ + +const IS_EE = require('../../config/helpers/is_ee_env'); +const IS_JH = require('../../config/helpers/is_jh_env'); + +const allPatterns = [ + { + ignore: !IS_EE, + pattern: 'ee/**/*.*', + }, + { + ignore: !IS_JH, + pattern: 'jh/**/*.*', + }, +]; + +const ignorePatterns = allPatterns.filter((x) => x.ignore).map((x) => x.pattern); + +module.exports = { ignorePatterns }; diff --git a/tooling/eslint-config/conditionally_ignore_ee.js b/tooling/eslint-config/conditionally_ignore_ee.js deleted file mode 100644 index e5e3c8013f432776353c1b932d18e316ec61fd2c..0000000000000000000000000000000000000000 --- a/tooling/eslint-config/conditionally_ignore_ee.js +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable import/no-commonjs */ - -const IS_EE = require('../../config/helpers/is_ee_env'); - -module.exports = IS_EE ? {} : { ignorePatterns: ['ee/**/*.*'] };