Have ideas to improve npm?Join in the discussion! »

    eslint-plugin-pathnames

    1.0.1 • Public • Published

    eslint-plugin-pathnames

    Build Status Coverage Status NPM Version

    Matches names of files and folders against a regular expression

    Installation

    $ npm install eslint-plugin-pathnames --save-dev
    

    Usage

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

    {
        "plugins": [
            "pathnames"
        ]
    }

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

    {
        "rules": {
            "pathnames/match": [
                "error",
                {
                    "fileNames": "^[0-9A-Za-z]+$",
                    "folderNames": "^[-_.0-9A-Za-z]+$",
                    "ignorePaths": "^(scripts|static)"
                }
            ]
        }
    }

    where:

    • fileNames is a regular expression that file names should match against (required);
    • folderNames is a regular expression that folder names should match against (optional, defaults to fileNames value);
    • ignorePaths is a regular expression that should match against relative paths of files that should be ignored (optional).

    Install

    npm i eslint-plugin-pathnames

    DownloadsWeekly Downloads

    16

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    4.94 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar