Giter Club home page Giter Club logo

functional-js-enforced's Introduction

functional-js-enforced

An experimental babel-plugin to enforce functional programming within JavaScript at build time.

Usage

What does it do?

  • give error on this (OOP construct)
  • give error on class (OOP construct)
  • give error on new (OOP construct)
  • give error on super (OOP construct)
  • give error var (unclear scoping)
  • give error on function expression (unclear scoping)
  • give error when assigning value to a variable outside the current function block (function purity)
  • function should always have a return as last statement (functional)
  • function should only have one return statement

(warning shotgun approach here)

  • give error on *.push (mutation)
  • give error on *.shift (mutation)
  • give error on *.sort (mutation)
  • give error on *.splice (mutation)
  • give error on *.unshift (mutation)
  • give error on *.copyWithin (mutation)
  • give error on *.pop (mutation)
  • give error on *.reverse (mutation)

Suggestions? Contributions?

Are very welcome!

License

MIT

functional-js-enforced's People

Contributors

sanderspies avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

functional-js-enforced's Issues

linter

Awesome idea! I'd just wish I could use it as a linter, also it does not seem to adhere to the babel plugin naming convention, making it impossible to load as a plugin. Or maybe I'm just to ignorant to figure it out ๐Ÿ˜“

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.