Skip to content
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

Is my custom eslint shareable config good like this or should I change it? #38

Closed
rfgamaral opened this issue Dec 9, 2019 · 8 comments

Comments

@rfgamaral
Copy link

I have created this shareable ESLint configuration and I'm wondering if the following:

module.exports = {
    settings: {
        'import/resolver': {
            typescript: {
                alwaysTryTypes: false,
            },
        },
    },
};

Is the same as:

module.exports = {
    settings: {
        'import/resolver': {
            typescript: {},
        },
    },
};

?

If not, could you be so kind in explaining the differences? Should I change this?

@JounQin
Copy link
Collaborator

JounQin commented Dec 9, 2019

@rfgamaral They're same anyway. But I'm using alwaysTryTypes: true always personally, because I'm also a maintainer of mdx now, and there is not related original package for @types/unist.

For sharable configuration, you can check the source codes of https://github.com/1stG/configs/tree/master/packages/eslint-config as reference.

@JounQin JounQin closed this as completed Dec 9, 2019
@rfgamaral
Copy link
Author

@JounQin I asked because I'm having a similar issue to #37 and I can't understand what's wrong with my configuration. I thought I could be doing something wrong with my ESLint config package.

I'll try to create a minimal reproducible repository tomorrow and post on the other issue, maybe you can understand what I'm doing wrong...

@JounQin
Copy link
Collaborator

JounQin commented Dec 10, 2019

@rfgamaral That's fine. I'm wondering if my PR helps?

@rfgamaral
Copy link
Author

@rfgamaral That's fine. I'm wondering if my PR helps?

I looked at that but there are so many changes that I'm not sure what's the bit that actually fixes the problem...

@JounQin
Copy link
Collaborator

JounQin commented Dec 10, 2019

@rfgamaral The key difference is that we should only have one .eslintrc for all files. Of course, if you still have problems, feel free to provide another minimal reproduction, I'll try to help fixing them.

@rfgamaral
Copy link
Author

@JounQin Actually, I'm not sure I have the same problem as #37. I mean, I get this error in VS Code with the ESLint extension: Unable to resolve path to module '@tier-based-promotions/core'.eslint(import/no-unresolved), however, running the eslint tool in the CLI doesn't give me any errors at all.

Maybe my problem is actually in the ESLint extension and not the configuration...?

@JounQin
Copy link
Collaborator

JounQin commented Dec 10, 2019

@rfgamaral Sorry, no idea about this.

@rfgamaral
Copy link
Author

@rfgamaral Sorry, no idea about this.

That's fine, no worries. Thanks for your support :)

Anyway, I've posted this if you're interested to follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants