Comments (7)
@surmaaa adding node.extensions
to my settings seems to have resolved the issue for me also.
My updated eslintrc.js
settings
object now looks like this:
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
webpack: {
config: './internals/webpack/webpack.prod.babel.js',
},
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
directory: './tsconfig.json',
},
},
'import/ignore': ['types'], // Weirdly eslint cannot resolve exports in types folder (try removing this later)
},
from react-boilerplate-typescript.
I am also experiencing this issue when running npm run lint
directly from the command line.
I have noticed that the module resolution is incorrect as it is routing internals
into node_modules/react-redux
.
I have also noticed that this issue begins to manifest when you have multiple copies of react-boilerplate-typescript
in the same project.
For instance I am using lerna to manage my monorepo, but I have been able to reproduce the error by creating a repo and cloning react-boilerplate-typescript
into two sub directories and removing their .git
directories.
It also seems to manifest when sharing a project directory with any other node app that has node_modules
.
I haven't had the time to dig too deeply into this, and have managed to work around it for now, but I am afraid that it is a sign of a deeper issue with dependency linking and module resolution.
Any insight into this would be very appreciated.
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint-import-resolver-webpack/index.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint-module-utils/resolve.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint-plugin-import/lib/index.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint/lib/cli-engine/config-array-factory.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint/lib/cli-engine/cli-engine.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint/lib/cli-engine/index.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint/lib/cli.js',
'/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/eslint/bin/eslint.js'
]
}
Error: Cannot find module '/home/austin/Workspace/Sophia/sophia-iot/frontend/node_modules/react-redux/internals/webpack/webpack.prod.babel.js'
from react-boilerplate-typescript.
Hmm interesting. @surmaaa does npm run lint
works fine for you? If it does then I think its related to eslint in webstorm, because I am using vscode and had no problem.
Adding ts
files to node extensions is a fix it seems. eslint-import-resolver-typescript
is used and I thought that does the trick for finding ts
files. I'll look into this.
from react-boilerplate-typescript.
Hmm interesting. @surmaaa does
npm run lint
works fine for you? If it does then I think its related to eslint in webstorm, because I am using vscode and had no problem.Adding
ts
files to node extensions is a fix it seems.eslint-import-resolver-typescript
is used and I thought that does the trick for findingts
files. I'll look into this.
I didn't check because I installed eslint-loader and it works fine.
However I checked npm run lint
and it failed on lint:css
so I changed script line to "stylelint \"./app/**/*.{js,ts,tsx}\""
but now it fails on "lint:eslint:quiet
what's strange I have proper errors from es-lint loader in browser and there it's not failing
from react-boilerplate-typescript.
Hmm interesting. @surmaaa does
npm run lint
works fine for you? If it does then I think its related to eslint in webstorm, because I am using vscode and had no problem.
Addingts
files to node extensions is a fix it seems.eslint-import-resolver-typescript
is used and I thought that does the trick for findingts
files. I'll look into this.I didn't check because I installed eslint-loader and it works fine.
However I checkednpm run lint
and it failed onlint:css
so I changed script line to"stylelint \"./app/**/*.{js,ts,tsx}\""
but now it fails on"lint:eslint:quiet
what's strange I have proper errors from es-lint loader in browser and there it's not failing
I copied a command from lint:eslint:quiet
and paste it into the console, there is no error so error above is just exit?
from react-boilerplate-typescript.
Eslint works for me I've had a problem with husky too so I had to reinstall it with cmd run as administrator (windows) so I think adding .ts and .tsx extensions to fix this error is enough
from react-boilerplate-typescript.
fixed in #71
from react-boilerplate-typescript.
Related Issues (20)
- Update the project with stricter typings HOT 1
- Update generator templates with latest changes HOT 1
- Replace tslint with eslint HOT 7
- invalid align-items property value HOT 1
- Add tsc --noEmit for type checking on pre-commit hook
- Syncing with the original upstream HOT 2
- delete `revert-26-patch_types`
- Not working with IE11 and some older edge versions HOT 1
- Remove project fork status to properly display contributions HOT 2
- Mark the repository as template
- Reasons for omitting immer HOT 1
- Convert server to use typescript HOT 5
- Can't import png file HOT 1
- `useInjectReducer` generates error in the console. HOT 10
- .
- error loading js file
- git clone repo and npm run setup gives error
- Not working.
- ngrok - platform darwinarm64 is not supported.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-boilerplate-typescript.