eslint-import-resolver-jspm
v2.1.0
Published
A jspm resolver for eslint-plugin-import
Downloads
1,268
Readme
eslint-import-resolver-jspm
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