@jsenv/eslint-import-resolver
v8.2.0
Published
Implement Node.js import resolution algorithm for ESLint.
Downloads
2,785
Readme
@jsenv/eslint-import-resolver
Implement Node.js import resolution algorithm for ESLint.
Usage
This section shows how to create a very basic ESLint configuration doing the following:
- Enable eslint-plugin-import
- Enable import/no-unresolved
- Configure import/resolver with
@jsenv/eslint-import-resolver
npm install --save-dev eslint-plugin-import
npm install --save-dev @jsenv/eslint-import-resolver
// .eslintrc.cjs
module.exports = {
plugins: ["import"],
rules: {
"import/no-unresolved": ["error"],
},
settings: {
"import/resolver": {
"@jsenv/eslint-import-resolver": {
rootDirectoryUrl: __dirname,
packageConditions: ["browser", "import"],
},
},
},
};
See also https://github.com/jsenv/eslint-config#advanced-configuration-example