eslint-plugin-import: import/no-relative-parent-imports report incorrectly in 2.20.1

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',
]

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 5
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@ljharb seems like the problem still show up on Windows 😦

ah, that codebase is on a remote machine 😄. I will spend some time try to setup a repo and test this out later

@ljharb Same problem as described in the issue: import 'reflect-metadata' is reported on windows while it works fine using linux.