Skip to content

EXTEND_ESLINT=true not working #9047

Closed
Closed
@Barik85

Description

@Barik85

Describe the bug

I created .env file in root directory with EXTEND_ESLINT=true
then created .eslint.json file with my config for eslint
but while running npm start this config doesn't work!
So I had to run npm run eject
in file '/config/webpack.config.js' on the line 38 I have found
const isExtendingEslintConfig = process.env.EXTEND_ESLINT === 'true';
but this variable never used.
So on line 339 I just added useEslintrc: isExtendingEslintConfig, and it begans work correctly!

            {
              options: {
                cache: true,
                formatter: require.resolve('react-dev-utils/eslintFormatter'),
                eslintPath: require.resolve('eslint'),
                resolvePluginsRelativeTo: __dirname,
                useEslintrc: isExtendingEslintConfig,
              },
              loader: require.resolve('eslint-loader'),
            },
          ],

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here.)

Steps to reproduce

  1. npx create-react-app my-app --template typescript
  2. add .env file in root directory with EXTEND_ESLINT=true
  3. add .eslint.json with some rules, for example "react/jsx-props-no-spreading": [0]
  4. Try to check if the rule is working. In my case it's not!

Expected behavior

Expect it will consider rules from .eslintrc.json

Actual behavior

Ignoring rules from .eslintrc.json

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions