GithubHelp home page GithubHelp logo

check-prop-types's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

check-prop-types's Issues

version 1.1.3 is not published to npm

Current version in npm is 1.1.2, which requires "prop-types": "<=15.6.0" - thus preventing usage with newer pro-types.
I see that it's fixed in 1.1.3, but latest version in npm is 1.1.2

As default 'prop-types' has checkPropTypes

Duplicate Module!

prop-types already have checkPropTypes() then why this module. Could you please explain the reason behind it?

To use! Just I need to import it in sample.spec.js or sample.js file

// import
import PropTypes, {checkPropTypes} from 'prop-types';

//... direct call that method

checkPropTypes(Sample.propTypes, expectedProps, 'props', Sample.name)

Thanks!

Add option to always run validation

Currently checkPropTypes() is wrapped in if (process.env.NODE_ENV !== 'production') { condition.

Can we add some config object as 6th parameter, something like:

function checkPropTypes(typeSpecs, values, location, componentName, getStack, { validateAlways: boolean }) {

Thanks

No Typescript definition file.

I'm converting my project to Typescript and am using check-prop-types all over the place in my testing.

I get this message:

Could not find a declaration file for module 'check-prop-types'. '/node_modules/check-prop-types/index.js' implicitly has an 'any' type.
Try npm install @types/check-prop-types if it exists or add a new declaration (.d.ts) file containing declare module 'check-prop-types';

Would it be possible to make a definition file?

Checking on objects

I'm checking proptypes on an object, but no errors are throw when one of the props in the object is incorrect.

For example:

SelectField.propTypes = {
  fieldData: PropTypes.shape({
    options: PropTypes.array.isRequired,
    label: PropTypes.string,
    required: PropTypes.bool.isRequired,
    type: PropTypes.string.isRequired,
    validation_message: PropTypes.string,
  }),
};

I set 'required' to empty and no error is returned.

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.