-
Notifications
You must be signed in to change notification settings - Fork 26.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react/require-extension is deprecated #978
Comments
Sadly the replacement rule can't yet be configured for us - it's blocked by import-js/eslint-plugin-import#390 (as indicated here). |
this makes working with airbnb in atom completely unusable, see AtomLinter/linter-eslint#579 (comment) |
- While waiting for the airbnb/javascript#978, we can't really upgrade to eslint 3.x
@barbalex you might want to vote for the culprit issue that causes Atom to throw the exception: jsx-eslint/eslint-plugin-react#783 |
@barbalex @billyjanitsch you can make your own override config, maybe this is a big hack but seems to work //airbnd-override.js
import omit from 'lodash/omit';
import merge from 'lodash/merge';
import airbnb from 'eslint-config-airbnb';
const config = airbnb.extends.reduce((acc, fp) => {
return merge(acc, require(fp));
}, {});
const {rules: allRules} = config;
const rules = omit(allRules, 'react/require-extension');
export default Object.assign({}, config, {rules});
//src/index.js => compiled to dist/index.js
export default {
parser: 'babel-eslint',
extends: [
'./airbnd-overwride.js'
].map(require.resolve),
env: {
'shared-node-browser': true
},
ecmaFeatures: {
experimentalObjectRestSpread: true
},
rules: {
'comma-dangle': 0,
'arrow-body-style': 0,
'object-curly-spacing': 0,
'global-require': 0
}
};
//.eslintrc
{
"extends": "./dist/index.js"
} |
that's a whole lot of work to avoid a single |
@ljharb truedat |
Temporary workaround for my project that is using eslint would be to add the rule to
|
@yangshun you absolute hero - that warning message was really annoying me! |
That helps make it usable, but I'm seeing problems with eslint-plugin-import; after settings |
Just to test - if you set it explicitly to "error", do all those import warnings go away? |
|
@ljharb Do you mean |
The latter :-) |
@ljharb Then I get that spooky error message: AtomLinter/linter-eslint#579 |
Wait - are you saying you get those linter errors in Atom, or on the command line? The only thing that matters for reporting to anything but $EDITOR is that it happens on the command line - anything happening in $EDITOR only is a specific bug that that project needs to fix. |
@JasonEtco are you using webpack resolve root? |
@yangshun No, I'm not. We opted for Gulp to build the app instead. Is there a setting to do that within Atom? (Sorry if this is off-topic) |
@JasonEtco The spooky error message is triggered by |
error: « The react/require-extension rule is deprecated. Please use the import/extensions rule from eslint-plugin-import instead. » see: airbnb/javascript#978 (comment)
This is now waiting on a release of |
|
This will need a major version update, so I'll try to get that out this weekend. |
v12.0.0 of the config should resolve this issue. |
…re-extension` rule Fixes airbnb#978.
…re-extension` rule Fixes airbnb#978.
This react/require-extension issue was fixed when I downgraded the node module "eslint-plugin-react" so as to get back this check rule. |
@goodaccoustics the check exists in a replacement rule; there's no need to downgrade. |
- While waiting for the airbnb/javascript#978, we can't really upgrade to eslint 3.x
See the deprecation notice. The newly released [email protected] includes this rule, so a warning is printed to the console.
The text was updated successfully, but these errors were encountered: