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

Conflict rules: newline-after-import with order #1811

Closed
Arttse opened this issue Jun 8, 2020 · 1 comment
Closed

Conflict rules: newline-after-import with order #1811

Arttse opened this issue Jun 8, 2020 · 1 comment

Comments

@Arttse
Copy link

Arttse commented Jun 8, 2020

Maybe a bug, with v2.20.2 works well.

// ESLint: There should be no empty line within import group(import/order)
import { ExecaReturnValue } from 'execa';

import execa = require('execa');

When remove 1 empty line:

// ESLint: Expected 1 empty line after import statement not followed by another import.(import/newline-after-import)
import { ExecaReturnValue } from 'execa';
import execa = require('execa');

Config rules
'import/newline-after-import': ['error'],
'import/order': [
  'error',
  {
    groups: [
      ['builtin', 'external', 'internal'],
      'unknown',
      'parent',
      ['sibling', 'index'],
    ],
    'newlines-between': 'always',
  },
],
OS Linux
node.js 12.18.0
eslint 7.2.0
eslint-plugin-import 2.21.1
@typescript-eslint/parser 3.1.0
typescript 3.9.5
@ljharb
Copy link
Member

ljharb commented Jun 8, 2020

This indeed looks like a bug in newline-after-import not understanding TypeScript's nonstandard import = syntax.

While I'd suggest enabling esModuleInterop and synthetic imports, and avoiding this syntax, this is still a bug we'll need to fix.

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

No branches or pull requests

2 participants