![]() ĭue to bugs either in VS Code or in specific packages' type declarations, the last two points don't always work. This is better described in this comment. I have a tsconfig.json in my baseDir that looks like this: only if any of your local files is importing them I've been doing it manually so far, but to be honest I'd rather wait 15 seconds for webstorm to find and add my import that have to dig around manually for it. Visual studio code isn't being very helpful about finding the dependencies I need and importing them. eslintrc.I'm in the process of making the move from Webstorm to Visual Studio Code. Of course, if you already have the others just… meteor npm install -save-dev eslint-import-resolver-meteor So add it to the “npm install” command recommended in the article as follows… meteor npm install -save-dev eslint-config-airbnb eslint-plugin-import eslint-import-resolver-meteor eslint-plugin-meteor eslint-plugin-react eslint-plugin-jsx-a11y eslint To expand on the installation of this, it is an NPM module. I dug into Meteor’s module code and found that not only are the absolute paths supported, but the very first test verifies that they work. But without this resolver, ESLint is telling everyone that they are errors, and people are confusing that with Meteor not supporting it. They are interpreted by Meteor as paths relative to the project root directory. I’ve seen many posts where people are indicating that absolute paths in import statements weren’t working. I just want to second this piece of advice and thank for it! This is the key to getting the false positive errors on absolute paths to go away. I eventually made it quiet with rules in package.json: "rules": ![]() Meteor npm install -save-dev eslint eslint-plugin-react eslint-plugin-meteor eslint-config-airbnbĪnd populating scripts and eslintConfig as above in package.json, then "meteor npm run lint" gave me: > lint /opt/www/sites/me/myappġ:26 error Unable to resolve path to module 'meteor/templating' import/no-unresolvedĢ:29 error Unable to resolve path to module 'meteor/reactive-var' import/no-unresolvedġ8:25 error Invalid parameter name, use "templateInstance" instead meteor/eventmap-paramsġ:24 error Unable to resolve path to module 'meteor/meteor' import/no-unresolved Or to be more precise – I was expecting it not to give errors, and it did. I’m thinking eslint shouldn’t give errors when following the guide, eg after creating a new default app. If someone could figure out the correct configuration for IntelliJ to use Meteor’s version of node and libraries, I think that would be an improvement. However, I could not find the eslint package anywhere in the ~/.meteor directory, or in my app’s. After some searching, I found the path to the Meteor version of node here. Once I got through all this, I wondered why I couldn’t configure IntelliJ to use the version of node/npm installed with Meteor. First, I suggest that you make it explicit that you need to install ESLint a second time for IntelliJ, and to do this you need to install node/npm globally, plus (at least in my case), you need to run the following command so that IntelliJ can find the eslint airbnb package: npm install -g eslint-config-airbnb I can run ESLint with the Meteor command just fine following the directions. I am trying to set up ESLint for Meteor and IntelliJ IDEA (i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |