eslint-import-resolver-meteor
eslint-import-resolver-meteor copied to clipboard
Missing file extension for "meteor/meteor"
When using this resolver, I get some errors on missing file extensions.
eslint config
extends: "airbnb"
parser: "babel-eslint"
parserOptions:
ecmaVersion: 6
ecmaFeatures:
experimentalObjectRestSpread: true
jsx: true
sourceType: "module"
rules:
# otherwise eslint will throw errors about meteor/* being missing
import/no-extraneous-dependencies: "off"
# _id and private vars are prefixed with _
no-underscore-dangle: "off"
settings:
import/resolver: "meteor"
eslint error:
1:26 error Missing file extension for "meteor/accounts-base" import/extensions
2:24 error Missing file extension for "meteor/meteor" import/extensions
code file:
import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';
This has only started happening for me with updating AirBnb config and ESLint.
https://github.com/airbnb/javascript/commit/f6dab799b8fa1346f1cc3fdfdbe9c9fbeef7baf6 introduced:
'import/extensions': ['error', 'always', {
js: 'never',
jsx: 'never',
}],
Previously was:
'import/extensions': ['off', 'never'],
I don't like this fix but you just have to turn it off like Airbnb previously:
rules:
import/extensions:
- off
- never
interesting, I think maybe the issue is that "core" modules are not properly ignored by import/extensions
when they are core relative to a specific module.
#19
I just installed this package and I started getting this file extension missing errors. Before I was with the latest airbnb and I wasn't getting any errors.
Still getting this error & it seems have to turn off it setting
"rules": {
"import/extensions": ["off", "never"]
}
until this issue closed.