import-js / import-js/eslint-plugin-import

import/no-relative-parent-imports report incorrectly in 2.20.1

Open
#1,644 15 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted typescript
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

In version 2.20.1, I start to get errors like:

Relative imports from parent directories are not allowed. Please either pass what ...

for

import React from 'react';

The problem did not occur in 2.20.0.

I use eslint-typescript but since this used to work in 2.20.0 I doubt that this has anything to do with that.

My .eslintrc.js looks like this

parser: '@typescript-eslint/parser',
parserOptions: {
  project: path.resolve(__dirname, './tsconfig.json')
},
plugins: [
  'react',
  'react-hooks'
],
extends: [
  'plugin:@typescript-eslint/recommended',
  'plugin:react/recommended',
  'plugin:import/errors',
  'plugin:import/warnings',
  'plugin:import/typescripts',
]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with eslint-plugin-import 2.20.1 and 2.20.0 using the supplied .eslintrc.js and the React import example. Trace the import/no-relative-parent-imports rule and its version change; done means the valid package import no longer produces this false error while genuine parent-directory imports remain reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.