Code Monkey home page Code Monkey logo

lint-ensure-named-export-rule's Introduction

ensure-named-export-rule

There is a rule to disallow default exports no-default-export.

This rule makes it, so to say, one step further.

ℹ️ Using ensure-named-export-rule one can assert that a module has named export named over the file name.

Lint tools support

  • tslint rule
  • eslint rule

How it works in a few words

A file, named mySuperModule.js, must have an export, also named mySuperModule.

The rule supports an option to specify case conversion. Using which one can say: A file, named mySuperModule.js, must a have an export, named my_super_module or MySuperModule etc.

Configuration example

"rules": {
  "ensure-named-export": [true, "pascalCase"]
}
"rules": {
  "ensure-named-export": [true, "camelCase"]
}

Supported cases by this rule: "camelCase", "constantCase", "pascalCase", "snakeCase"

(Why not all from the change-case? Because the rest of them seem to have no sense in this context)

Dependencies

Case conversion is done with change-case ❤️

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.