Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/platform/packages/shared/kbn-cell-actions/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -116,7 +122,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -127,7 +133,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,24 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -116,7 +121,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -127,7 +132,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
18 changes: 12 additions & 6 deletions x-pack/solutions/security/packages/connectors/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -114,7 +120,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -125,7 +131,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -114,7 +120,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -125,7 +131,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
18 changes: 12 additions & 6 deletions x-pack/solutions/security/packages/features/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -114,7 +120,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -125,7 +131,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
18 changes: 12 additions & 6 deletions x-pack/solutions/security/packages/navigation/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -114,7 +120,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -125,7 +131,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
18 changes: 12 additions & 6 deletions x-pack/solutions/security/packages/side-nav/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -114,7 +120,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -125,7 +131,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
18 changes: 12 additions & 6 deletions x-pack/solutions/security/packages/upselling/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@

// eslint-disable-next-line import/no-nodejs-modules
const path = require('path');
// eslint-disable-next-line import/no-nodejs-modules
const { execSync } = require('child_process');

const minimatch = require('minimatch');

/** @type {Array.<RestrictedImportPath>} */
const RESTRICTED_IMPORTS = [
const RESTRICTED_IMPORTS_PATHS = [
{
name: 'enzyme',
message: 'Please use @testing-library/react instead',
},
];

// root directory of the project dynamically calculated
const ROOT_DIR = process.cwd();
const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // e.g. ../../../../..
const ROOT_DIR = execSync('git rev-parse --show-toplevel', {
encoding: 'utf8',
cwd: __dirname,
}).trim();

const ROOT_CLIMB_STRING = path.relative(__dirname, ROOT_DIR); // i.e. '../../..'

/** @type {import('eslint').Linter.Config} */
const rootConfig = require(`${ROOT_CLIMB_STRING}/.eslintrc`); // eslint-disable-line import/no-dynamic-require
Expand Down Expand Up @@ -114,7 +120,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
// Dynamic duplicates removal for all restricted imports
const existingPaths = modernConfig.paths.filter(
(existing) =>
!RESTRICTED_IMPORTS.some((restriction) =>
!RESTRICTED_IMPORTS_PATHS.some((restriction) =>
typeof existing === 'string'
? existing === restriction.name
: existing.name === restriction.name
Expand All @@ -125,7 +131,7 @@ for (const override of overridesWithNoRestrictedImportRule) {
const newRuleConfig = [
severity,
{
paths: [...existingPaths, ...RESTRICTED_IMPORTS],
paths: [...existingPaths, ...RESTRICTED_IMPORTS_PATHS],
patterns: modernConfig.patterns,
},
];
Expand Down
Loading