Naboo's Podracing Misadventure

    @laurentgoudet/eslint-import-resolver-jspm

    2.1.0 • Public • Published

    eslint-import-resolver-jspm

    npm package dependency status

    A jspm resolver for eslint-plugin-import.

    Installation

    npm install --save-dev eslint-plugin-import eslint-import-resolver-jspm

    Usage

    Pass this resolver to eslint-plugin-import using your .eslintrc:

    In YAML:

    ---
    settings:
      import/resolver:
        jspm: { moduleDirectory: jspm_packages }
        node: true

    In JSON:

    ---
    "settings": {
      "import/resolver": {
        "jspm": {
          "moduleDirectory": "jspm_packages"
        },
        "node": true
      }
    }

    eslint-plugin-import parameters are identical to resolve, plus these:

    • pathsOverride: (Object) Override paths set in your jspm config file.
    • rootDir: (String) Specify a custom jspm root directory (relative to your project's root).

    Sample config

    {
        "plugins": [
            "import"
        ],
        "settings": {
            "import/ignore": [
                "jspm_packages",
                "node_modules",
                ".(scss|less|css)$",
                ".[^js(x)?]+$"
            ],
            "import/resolve": {
                "moduleDirectory": [
                    "jspm_packages",
                    "node_modules",
                    "."
                ]
            },
            "import/resolver": {
                "jspm": {
                    "moduleDirectory": "jspm_packages", // Override, don't look for jspm_packages in node_modules
                    "pathsOverride": {
                        "public": "src" // maps public/foo.js -> src/foo.js
                    },
                    "rootDir": "./path/to/custom/jspmRootDir"
                },
    
                "node": true // Set to true to fall back to Node resolver
            }
        }
    }

    See eslint-plugin-import for a full list of options.

    License

    MIT

    Install

    npm i @laurentgoudet/eslint-import-resolver-jspm

    DownloadsWeekly Downloads

    0

    Version

    2.1.0

    License

    MIT

    Last publish

    Collaborators

    • laurentgoudet