Skip to content

Commit

Permalink
Merge pull request #4346 from greenbone/fix-relative-paths
Browse files Browse the repository at this point in the history
remove relative paths
  • Loading branch information
daniele-mng authored Feb 24, 2025
2 parents 746e95b + 6f9de6d commit 9da9529
Show file tree
Hide file tree
Showing 1,069 changed files with 1,891 additions and 2,212 deletions.
12 changes: 11 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import globals from 'globals';
import * as importPlugin from 'eslint-plugin-import';
import vitest from '@vitest/eslint-plugin';
import allowedSnakeCase from './allowedSnakeCase.js';

pluginHeader.rules.header.meta.schema = false; // https://github.com/Stuk/eslint-plugin-header/issues/57

const year = new Date().getFullYear();
Expand Down Expand Up @@ -129,6 +128,17 @@ export default [
},
},
],
'no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['./', '../'],
message: 'Relative imports are not allowed.',
},
],
},
],
},
},

Expand Down
3 changes: 1 addition & 2 deletions src/__tests__/version.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {RELEASE_VERSION} from '../version';
import {RELEASE_VERSION} from 'src/version';

describe('Version tests', () => {
test('release version should only contain major.minor', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/__tests__/cancel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect} from '@gsa/testing';

import CancelToken from '../cancel.js';
import CancelToken from 'gmp/cancel.js';

describe('CancelToken tests', () => {
test('new CancelToken resolve', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/__tests__/cvss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {
parseCvssV2BaseFromVector,
parseCvssV2BaseVector,
parseCvssV3BaseFromVector,
parseCvssV3BaseVector,
} from '../parser/cvss';
} from 'gmp/parser/cvss';

const cvss_v2_entries = {
entries: [
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/__tests__/gmp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import {
afterAll,
testing,
} from '@gsa/testing';

import Gmp from '../gmp';
import DefaultTransform from '../http/transform/default';
import Gmp from 'gmp/gmp';
import DefaultTransform from 'gmp/http/transform/default';

describe('Gmp tests', () => {
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/gmp/__tests__/log.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
afterEach,
testing,
} from '@gsa/testing';
import {RootLogger, DEFAULT_LOG_LEVEL, LogLevels} from 'gmp/log.js';
import {isFunction} from 'util';

import {RootLogger, DEFAULT_LOG_LEVEL, LogLevels} from '../log.js';

let origConsole;
let testConsole;
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/__tests__/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import {describe, test, expect} from '@gsa/testing';
import {isDate, isDuration} from 'gmp/models/date';

import {
parseCsv,
parseBoolean,
Expand All @@ -26,13 +25,13 @@ import {
NO_VALUE,
setProperties,
parseToString,
} from '../parser';
} from 'gmp/parser';
import {
parseCvssV2BaseVector,
parseCvssV3BaseVector,
parseCvssV2BaseFromVector,
parseCvssV3BaseFromVector,
} from '../parser/cvss';
} from 'gmp/parser/cvss';

describe('parseInt tests', () => {
test('should parse int number string', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/__tests__/timezones.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import {describe, test, expect, expectTypeOf} from '@gsa/testing';

import timezones from '../timezones';
import {isArray} from '../utils/identity';
import timezones from 'gmp/timezones';
import {isArray} from 'gmp/utils/identity';

describe('timezones tests', () => {
test('should be a list of timezone objects', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/capabilities/__tests__/capabilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect} from '@gsa/testing';

import Capabilities from '../capabilities';
import Capabilities from 'gmp/capabilities/capabilities';

describe('Capabilities tests', () => {
test('should not have capabilities', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/capabilities/__tests__/everything.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect} from '@gsa/testing';

import EverythingCapabilities from '../everything';
import EverythingCapabilities from 'gmp/capabilities/everything';

describe('EverythingCapabilities tests', () => {
test('should allow everything', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/gmp/capabilities/everything.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import Capabilities from './capabilities.js';
import Capabilities from 'gmp/capabilities/capabilities.js';

class EverythingCapabilities extends Capabilities {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions src/gmp/collection/collectioncounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import {parseInt} from '../parser.js';
import {isDefined} from '../utils/identity';
import {parseInt} from 'gmp/parser.js';
import {isDefined} from 'gmp/utils/identity';

class CollectionCounts {
/**
Expand Down
12 changes: 6 additions & 6 deletions src/gmp/collection/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import logger from '../log';
import Model from '../model';
import CollectionCounts from './collectioncounts';
import Filter from '../models/filter';
import {map} from '../utils/array';
import {isArray, isDefined} from '../utils/identity';
import CollectionCounts from 'gmp/collection/collectioncounts';
import logger from 'gmp/log';
import Model from 'gmp/model';
import Filter from 'gmp/models/filter';
import {map} from 'gmp/utils/array';
import {isArray, isDefined} from 'gmp/utils/identity';

const log = logger.getLogger('gmp.collection.parser');

Expand Down
14 changes: 7 additions & 7 deletions src/gmp/commands/__tests__/audit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
*/

import {describe, test, expect} from '@gsa/testing';
import {AuditCommand, AuditsCommand} from 'gmp/commands/audits';
import {
createActionResultResponse,
createEntityResponse,
createEntitiesResponse,
createHttp,
} from 'gmp/commands/testing';
import {ALL_FILTER} from 'gmp/models/filter';
import {
OPENVAS_SCANNER_TYPE,
Expand All @@ -15,13 +22,6 @@ import {
AUTO_DELETE_KEEP,
} from 'gmp/models/task';

import {AuditCommand, AuditsCommand} from '../audits';
import {
createActionResultResponse,
createEntityResponse,
createEntitiesResponse,
createHttp,
} from '../testing';

describe('AuditCommand tests', () => {
test('should create new audit', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/gmp/commands/__tests__/auditreports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import {describe, test, expect} from '@gsa/testing';
import {AuditReportsCommand} from 'gmp/commands/auditreports';
import {ALL_FILTER} from 'gmp/models/filter';

import {
createHttp,
createEntitiesResponse,
createAggregatesResponse,
} from '../testing';
} from 'gmp/commands/testing';
import {ALL_FILTER} from 'gmp/models/filter';


describe('AuditReportsCommand tests', () => {
test('should return all audit reports', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {AuthenticationCommand} from '../auth';
import {createActionResultResponse, createHttp} from '../testing';
import {AuthenticationCommand} from 'gmp/commands/auth';
import {createActionResultResponse, createHttp} from 'gmp/commands/testing';

describe('AuthenticationCommand tests', () => {
test('should enable ldap', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/commands/__tests__/convert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {convertBoolean} from '../convert';
import {convertBoolean} from 'gmp/commands/convert';

describe('convertBoolean tests', () => {
test('should convert true', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/commands/__tests__/dashboards.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect, testing} from '@gsa/testing';

import {DEFAULT_ROW_HEIGHT, createDisplay, createRow} from '../dashboards';
import {DEFAULT_ROW_HEIGHT, createDisplay, createRow} from 'gmp/commands/dashboards';

describe('createRow tests', () => {
test('should create row with default height', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/entities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/

import {describe, test, expect} from '@gsa/testing';
import EntitiesCommand from 'gmp/commands/entities';
import {createEntitiesResponse, createHttp} from 'gmp/commands/testing';
import Filter from 'gmp/models/filter';

import EntitiesCommand from '../entities';
import {createEntitiesResponse, createHttp} from '../testing';

describe('EntitiesCommand tests', () => {
test('should add filter parameter', () => {
const filter = Filter.fromString('foo=bar');
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/entity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/

import {describe, test, expect} from '@gsa/testing';
import EntityCommand from 'gmp/commands/entity';
import {createEntityResponse, createHttp} from 'gmp/commands/testing';
import Filter from 'gmp/models/filter';

import EntityCommand from '../entity';
import {createEntityResponse, createHttp} from '../testing';

class TestEntityCommand extends EntityCommand {
getModelFromResponse(response) {
return response.data;
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/feedstatus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import {describe, test, expect, testing} from '@gsa/testing';

import {FeedStatus} from '../feedstatus';
import {createResponse, createHttp} from '../testing';
import {FeedStatus} from 'gmp/commands/feedstatus';
import {createResponse, createHttp} from 'gmp/commands/testing';

describe('FeedStatusCommand tests', () => {
test('should return feed information', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/commands/__tests__/http.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/

import {describe, test, expect, testing} from '@gsa/testing';

import HttpCommand from '../http';
import HttpCommand from 'gmp/commands/http';

describe('HttpCommand tests', () => {
test('should return itself from setting default param', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/license.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/

import {describe, test, expect} from '@gsa/testing';
import {LicenseCommand} from 'gmp/commands/license';
import {createResponse, createHttp} from 'gmp/commands/testing';
import {parseDate} from 'gmp/parser';

import {LicenseCommand} from '../license';
import {createResponse, createHttp} from '../testing';

describe('LicenseCommand tests', () => {
test('should request license', () => {
const response = createResponse({
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/nvt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {NvtCommand} from '../nvt';
import {createResponse, createHttp} from '../testing';
import {NvtCommand} from 'gmp/commands/nvt';
import {createResponse, createHttp} from 'gmp/commands/testing';

describe('NvtCommand tests', () => {
test('should request single nvt', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/nvtfamilies.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {NvtFamiliesCommand} from '../nvtfamilies';
import {createResponse, createHttp} from '../testing';
import {NvtFamiliesCommand} from 'gmp/commands/nvtfamilies';
import {createResponse, createHttp} from 'gmp/commands/testing';

describe('NvtFamiliesCommand tests', () => {
test('should load nvt families', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/policies.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/

import {describe, test, expect} from '@gsa/testing';
import {PoliciesCommand} from 'gmp/commands/policies';
import {createEntitiesResponse, createHttp} from 'gmp/commands/testing';
import {ALL_FILTER} from 'gmp/models/filter';

import {PoliciesCommand} from '../policies';
import {createEntitiesResponse, createHttp} from '../testing';

describe('PoliciesCommand tests', () => {
test('should return all policies', () => {
const response = createEntitiesResponse('config', [
Expand Down
16 changes: 8 additions & 8 deletions src/gmp/commands/__tests__/policy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
*/

import {describe, test, expect} from '@gsa/testing';
import {PolicyCommand} from 'gmp/commands/policies';
import {
createActionResultResponse,
createEntityResponse,
createHttp,
createHttpMany,
createResponse,
} from 'gmp/commands/testing';
import {
SCANCONFIG_TREND_DYNAMIC,
SCANCONFIG_TREND_STATIC,
BASE_SCAN_CONFIG_ID,
} from 'gmp/models/scanconfig';
import {YES_VALUE, NO_VALUE} from 'gmp/parser';

import {PolicyCommand} from '../policies';
import {
createActionResultResponse,
createEntityResponse,
createHttp,
createHttpMany,
createResponse,
} from '../testing';

describe('PolicyCommand tests', () => {
test('should create new policy', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/__tests__/report.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import {describe, test, expect} from '@gsa/testing';

import {ReportCommand} from '../reports';
import {createHttp, createEntityResponse} from '../testing';
import {ReportCommand} from 'gmp/commands/reports';
import {createHttp, createEntityResponse} from 'gmp/commands/testing';

describe('ReportCommand tests', () => {
test('should request single report', () => {
Expand Down
Loading

0 comments on commit 9da9529

Please sign in to comment.