Skip to content

chadly/eslint-plugin-inflection

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ESLint Filename Inflection Plugin

ESLint plugin to check inflection of filenames

Add rules for whether or not filenames should be plural or singular.

Install

npm install eslint-plugin-inflection --save

Usage

Add to your .eslintrc.yml:

plugins:
  - inflection
rules:
  inflection/no-plural-filenames:
    - error

or

plugins:
  - inflection
rules:
  inflection/no-singular-filenames:
    - warn

It does what is sounds like it should do. With the no-plural-filenames rule enabled, these would be valid filenames:

  • bus.js
  • octopus.js
  • woman.js
  • here-is-the-woman.js
  • HERE_IS_THE_WOMAN.JS
  • hereIsTheWoman.js

while these would be invalid:

  • buses.js
  • octopi.js
  • women.js
  • here-are-the-women.js
  • HERE_ARE_THE_WOMEN.JS
  • hereAreTheWomen.js

For the no-singular-filenames rule, it would be the opposite.

About

ESLint plugin to check inflection of filenames

Resources

License

Stars

Watchers

Forks

Packages

No packages published