kleros/kleros-v2

View on GitHub
contracts/scripts/utils/env.ts

Summary

Maintainability
A
0 mins
Test Coverage

'namespace' and 'module' are disallowed
Open

namespace env {
  export const require = (key: string): string => {
    const value = process.env[key];
    if (value === undefined) {
      throw new Error(`Environment variable ${key} is undefined`);
Severity: Minor
Found in contracts/scripts/utils/env.ts by tslint

Rule: no-namespace

Disallows use of internal modules and namespaces.

This rule still allows the use of declare module ... {}

Rationale

ES6-style external modules are the standard way to modularize code. Using module {} and namespace {} are outdated ways to organize TypeScript code.

Notes
  • TypeScript Only

Config

One argument may be optionally provided:

  • allow-declarations allows declare namespace ... {} to describe external APIs.
Examples
"no-namespace": true
"no-namespace": true,allow-declarations
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "allow-declarations"
    ]
  },
  "minLength": 0,
  "maxLength": 1
}

For more information see this page.

There are no issues that match your filters.

Category
Status