question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.eslintrc doesn't override defaults

See original GitHub issue

First of all, thank you for the great tool!

Current Behavior

tsdx ignores .eslintrc.js or .eslintrc.json in project’s root directory and uses default config when lint script is run. At the moment it is possible to redefine default linting config only by specifying necessary settings in eslint key inside package.json. It is quite inconvenient.

Desired Behavior

Use .eslintrc.js or .eslintrc.json when it is present in project’s root directory to redefine/replace default config.

Suggested Solution

Check presence of .eslintrc.js or .eslintrc.json in project’s root directory and use its contents instead of default config returned by createEslintConfig.

Who does this impact? Who is this for?

All users wanting to customize linting settings.

Describe alternatives you’ve considered

Additional context

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
gamtiqcommented, Feb 23, 2020

Sorry, I missed #498 (I searched only for open issues). I’ve added the following snippet in .eslintrc.js

    rules: {
        'prettier/prettier': 'off'
    }

as mentioned in the comment for 498 and fixed the problem.

By the way, I suppose the info from this comment (about You can change everything, but one difference with using an eslintrc file is that the internal rules will be added to any custom ones, unless you’ve specifically set them to off in your rules.) and this comment (adding 'prettier/prettier': 'off' to rules) should be added into README.md to avoid confusion.

0reactions
agilgur5commented, Mar 3, 2020

it’d be a lot easier if the ESLint API handled it, but idk that it does.

Seems like there might be a way to hack it together with CLIEngine#getConfigForFile, but there isn’t really an exact API to check for existence of config, so I might have to file an issue with ESLint

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslintrc doesn't override defaults · Issue #498 · jaredpalmer/tsdx
Currently, settings from the package.json.eslint property will override any configurations during linting, but not the rules from .eslintrc ...
Read more >
How can I override default .eslint rules at runtime in a create ...
1 Answer 1 · Create a .env file in your root, if you don't have one. · Add the following to it as...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
Nested overrides settings are applied only if the glob patterns of both the parent config and the child config are matched. This is...
Read more >
Command Line Interface - ESLint - Pluggable JavaScript Linter
Argument Type: No argument. You can use these options to override the default behavior, which is to enable colorized output unless no TTY...
Read more >
Configuration Files (New) - ESLint - Pluggable JavaScript Linter
If you pass a non-JavaScript file, like example.txt , the semi rule is not ... You can optionally override the default parser by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found