[import/newline-after-import] false positive with typescript import = require
See original GitHub issueWhen using import/newline-after-import
with typescript import = require(..)
I get a false positive requiring me to put a newline in the middle of the imports.
import foo from "foo";
import bar = require("bar");
import baz from "baz";
Expected results
No errors
Actual results
1:1 error Expected 1 empty line after import statement not followed by another import import/newline-after-import
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[import/newline-after-import] false positive with ... - GitHub
When using import/newline-after-import with typescript import = require(..) I get a false positive requiring me to put a newline in the ...
Read more >Typescript + Eslint false positive for imports + `declare global`
1 Answer 1 ... Turn off "no-undef": "off"(disallow the use of undeclared variables unless mentioned in /*global */ comments) and to be handled...
Read more >@01taylop/eslint-plugin-import - NPM Package Overview - Socket
Start using Socket to analyze @01taylop/eslint-plugin-import and its 13 ... [ export ]/TypeScript: false positive for typescript namespace merging ([#1964], ...
Read more >node_modules/eslint-plugin-import/CHANGELOG.md - GitLab
TypeScript : [ import/named ]: avoid requiring typescript when not using TS ... prefer-default-export : fix false positive with type export ...
Read more >eslint-config-torchbox - npm
Shareable ESLint config following Torchbox's code style. ... eslint-config-prettier@8.5.0 - eslint-plugin-import@2.25.4 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also got into valid for typescript case:
Should be: VALID:
INVALID:
INVALID:
INVALID:
(I’d still strongly recommend everyone migrate away from TS-specific syntax;
import X from 'Y'
is what should be used in that case, with synthetic imports and esModuleInterop enabled, astsc --init
enables)