JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 344702
  • Score
    100M100P100Q177986F
  • License Apache-2.0

ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder

Package Exports

  • eslint-plugin-check-file
  • eslint-plugin-check-file/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-check-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-plugin-check-file

ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-check-file:

npm install eslint-plugin-check-file --save-dev

Usage

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

{
    "plugins": [
        "check-file"
    ]
}

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

{
   "rules":{
      "check-file/folder-match-with-fex":[
         "error",
         {
            "*.test.{js,jsx,ts,tsx}":"**/__tests__/",
            "*.styled.{jsx,tsx}":"**/pages/"
         }
      ],
      "check-file/filename-naming-convention":[
         "error",
         {
            "**/*.{jsx,tsx}":"CAMEL_CASE",
            "**/*.{js,ts}":"KEBAB_CASE"
         }
      ],
      "check-file/no-index":"error",
      "check-file/folder-naming-convention":[
         "error",
         {
            "src/**/":"CAMEL_CASE",
            "mocks/*/":"KEBAB_CASE"
         }
      ]
   }
}

Supported Rules