-
Notifications
You must be signed in to change notification settings - Fork 580
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
ESLintBear doesn't resolve relative impoarts #741
Comments
Thanks for reporting this issue! A coalaian will look at it soon. |
How can I reproduce this ?
and
I get If yes, please share configs and steps to set up [0] - https://medium.com/@tkssharma/eslint-in-react-babel-webpack-9cb1c4e86f4e#.x5p2kanc9 |
Ah we had a config. @oreqizer can we share your eslint config publicly or to him privately? |
{
"parser": "babel-eslint",
"plugins": ["react", "flowtype"],
"extends": "airbnb",
"env": {
"node": true,
"browser": true
},
"rules": {
// Flow
// ---
"flowtype/define-flow-type": "error", // teaches ESlint Flow types
"no-duplicate-imports": "off", // we need to import types separately
// Kiwi style
// ---
"semi": ["error", "never"],
"indent": ["error", "tab"],
"react/jsx-indent": ["error", "tab"],
"react/jsx-indent-props": ["error", "tab"],
"max-len": ["warn", { "code": 150 }], // will get reduced eventually
"dot-notation": ["off"], // we use bracket notation for external inputs (API, url params, ...)
"react/jsx-filename-extension": [1, { "extensions": [".js"] }],
"new-cap": "off", // Because Immutable.js
"no-underscore-dangle": "off", // __LOG
// Strajk & Michael don't care
"jsx-a11y/label-has-for": "off", // we put inputs into labels
"one-var": ["off"], // we like this
"one-var-declaration-per-line": ["off"], // we like this
"no-else-return": ["off"], // everybody got his own taste
"react/prop-types": ["off"],
"import/prefer-default-export": ["off"],
// known 'babel-eslint' bug
// ---
"generator-star-spacing": "off",
// Fix gradually
// ---
"no-unused-expressions": "warn",
"vars-on-top": "warn",
"no-prototype-builtins": "warn",
"no-unused-vars": "warn",
"default-case": "warn",
"radix": "warn", // Wanna use Number(…)
"func-names": "warn",
"no-mixed-operators": "warn",
// Fix automatically someday
// ---
"object-shorthand": "off", // TODO: try `consistent-as-needed`
"quotes": ["off", "double", "avoid-escape"],
"no-trailing-spaces": "off",
"no-var": "off",
"quote-props": "off",
"comma-dangle": "off",
"object-curly-spacing": "off",
"prefer-template": "off",
"prefer-const": "off",
"import/no-duplicates": "off",
"padded-blocks": "off",
"spaced-comment": "off",
"import/imports-first": "off",
"react/jsx-space-before-closing": "off",
"jsx-a11y/img-has-alt": "off",
"react/sort-comp": "off",
"react/no-find-dom-node": "off",
"react/no-string-refs": "off",
// Codemod
"react/prefer-stateless-function": "warn",
"react/prefer-es6-class": "warn",
"arrow-body-style": "off",
},
} |
@oreqizer would you be willing to investigate this, write a test and fix so we can switch the project? |
i'll try to look into it |
@oreqizer assigning you then, ping us if you need help or want to drop this! |
From the discussions we had the most likely solution will be not using stdin to feed the file but give eslint the filename as an argument instead, then it should figure that out. Alternatively we could possibly give it the filename with an argument if eslint exposes that. |
Adds information about current file location for ESLint. Aids in relative imports. Fixes #741
Adds information about current file location for ESLint. Aids in relative imports. Fixes coala#741
ESLintBear is used with stdin in coala to use the in memory file contents. HOwever imports seem to be relative in JS which means that ESLint things probably that they are relative to the CWD which leads to lots of false errors and not working imports.
type/bug area/lintbears importance/high difficulty/low probably
The text was updated successfully, but these errors were encountered: