Coder Social home page Coder Social logo

environment-enforcer's People

Contributors

dependabot[bot] avatar dgreene1 avatar

Watchers

 avatar  avatar

Forkers

mellis481

environment-enforcer's Issues

Make limitations known and clear via Errors (to enhance discoverability)

No one likes unhandled errors, but if we return errors that act as documentation... then we can be clear about this library’s current limitations and/or design goals. For instance...

Limitations:

  • don’t support the use of aliases (ie the type keyword)
  • Don’t support extending interfaces

Design Goals (to list a few that might be controversial and need to explaining):

  • to not allow the environment variables object just to become an object with any string and any value. That would make this library as useful as process.env itself.

typeParameters is not coming through

After integrating environment-enforcer into my repo, I'm seeing typeParameters is not coming through here resulting in the following error:

This macro requires you to explicitly pass the type parameter for the interface that defines the contract for which each environment variable file must adhere to. However, we did not find a type parameter for this node: {"type":"CallExpression","callee":{"type":"Identifier","name":"cov_78iegp7dg"},"arguments":[]}"

As you can see, p.node (logged above) has no typeParameters prop.

In the unit tests in this repo, I see that p.node is:

 {
        type: 'CallExpression',
        start: 136,
        end: 173,
        loc: SourceLocation {
          start: Position { line: 7, column: 23 },
          end: Position { line: 7, column: 60 },
          filename: undefined,
          identifierName: undefined
        },
        range: undefined,
        leadingComments: undefined,
        trailingComments: undefined,
        innerComments: undefined,
        extra: undefined,
        callee: Node {
          type: 'MemberExpression',
          start: 136,
          end: 161,
          loc: SourceLocation {
            start: [Position],
            end: [Position],
            filename: undefined,
            identifierName: undefined
          },
          range: undefined,
          leadingComments: undefined,
          trailingComments: undefined,
          innerComments: undefined,
          extra: undefined,
          object: Node {
            type: 'Identifier',
            start: 136,
            end: 155,
            loc: [SourceLocation],
            range: undefined,
            leadingComments: undefined,
            trailingComments: undefined,
            innerComments: undefined,
            extra: undefined,
            name: 'EnvironmentEnforcer'
          },
          computed: false,
          property: Node {
            type: 'Identifier',
            start: 156,
            end: 161,
            loc: [SourceLocation],
            range: undefined,
            leadingComments: undefined,
            trailingComments: undefined,
            innerComments: undefined,
            extra: undefined,
            name: 'parse'
          }
        },
        arguments: [],
        typeParameters: Node {
          type: 'TSTypeParameterInstantiation',
          start: 161,
          end: 171,
          loc: SourceLocation {
            start: [Position],
            end: [Position],
            filename: undefined,
            identifierName: undefined
          },
          range: undefined,
          leadingComments: undefined,
          trailingComments: undefined,
          innerComments: undefined,
          extra: undefined,
          params: [ [Node] ]
        }
      }

I'm unclear why typeParameters are not being passed through successfully.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.