Closed misteral closed 7 years ago
Have you npm install
ed?
@benmosher yes, does not have the error if I copy file into app
folder.
Where is your eslintrc?
@benmosher eslintrc is above.
Well, for one thing, nested package.json
s aren't currently supported for no-extraneous-dependencies
, see #458 for tracking/details.
As for resolving modules in ./app/node_modules
, I think you might need
"node": {
"paths": [
"./app",
"./app/node_modules"
],
"moduleDirectory": [
"node_modules"
]
},
},
as your import/resolver
config, but I'm not sure.
@benmosher thanks for answer, but I got same errors:
$ eslint src/desky/Comment.js
The react/require-extension rule is deprecated. Please use the import/extensions rule from eslint-plugin-import instead.
/data/desky-for-gitlab/src/desky/Comment.js
1:1 error 'jquery' should be listed in the project's dependencies. Run 'npm i -S jquery' to add it import/no-extraneous-dependencies
1:15 error Unable to resolve path to module 'jquery' import/no-unresolved
2:1 error 'guid' should be listed in the project's dependencies. Run 'npm i -S guid' to add it import/no-extraneous-dependencies
2:18 error Unable to resolve path to module 'guid' import/no-unresolved
3:1 error 'jcanvas' should be listed in the project's dependencies. Run 'npm i -S jcanvas' to add it import/no-extraneous-dependencies
3:21 error Unable to resolve path to module 'jcanvas' import/no-unresolved
current eslintrc.js config:
module.exports = {
"settings": {
"import/core-modules": [ 'electron' ],
"import/resolver:": {
"node": {
"paths": [
"./app",
"./app/node_modules"
],
"moduleDirectory": [
"node_modules"
]
},
},
},
"env": {
"browser": true,
"es6": true,
"node": true,
},
"extends": "airbnb",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
};
Any update about this issue?
@toomuchdesign thank you. I think we can close issue.
It's still an issue.
@binarymist then please file a new issue with repro steps
Please help. I am stuck with node resolver configuration.
Project folder structure as the same: https://github.com/szwacz/electron-boilerplate.
In simple words:
app
folder includenode_project
folder andpackage.json
file and static js filessrc
folder include dinamic js files with import modules.Part of file example:
I get eslint errors with this file in
src
folder:How I can resolve import node packages like 'jquery' in
src
folder?I try use this eslint config, but it not work: