Skip to content

ggarek/lint-ensure-named-export-rule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ❤️

About

Lint rule to ensure named export presence

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published