eslint-plugin-better-exports
v1.0.1
Published
An ESLint plugin for writing better exports
Maintainers
Readme
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 eslintNext, install eslint-plugin-better-exports:
$ npm i -D eslint-plugin-better-exports
$ yarn add -D eslint-plugin-better-exportsUsage
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
- 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 namedMyFile.
- Matches the name of the file exactly with what's being exported out of it. If the name of the file is
- Checks if there's only one thing being exported out of a file.
