Skip to content

yourAverageDeveloper/eslint-plugin-better-exports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-better-exports

An ESLint plugin for writing better exports. If you're a fan of ES modules (named exports to be specific), this plugin is for you.

Installation

You'll first need to install ESLint:

$ npm i -D eslint

$ yarn add -D eslint

Next, install eslint-plugin-better-exports:

$ npm i -D eslint-plugin-better-exports 

$ yarn add -D eslint-plugin-better-exports

Usage

Add better-exports to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "better-exports"
  ]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "better-exports/rule-name": 2
  }
}

Supported Rules

  • exact-case-match

    • Matches the name of the file exactly with what's being exported out of it. If the name of the file is MyFile.tsx, the component being exported out should also be named MyFile.
  • single-named-export-per-file

    • Checks if there's only one thing being exported out of a file.

About

An ESLint plugin to help you write better exports

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published