How to remove newline between import groups?
See original GitHub issueThanks for nice plugin!
I tried to use this and had one question. How to remove newline between import groups? (Or is there no option to remove line breaks?)
import fetch from 'cross-fetch'
import { NextPage } from 'next'
import Link from 'next/link'
import React from 'react'
// I want to delete ↑ line...
import { Head } from '~/components/abstracts/head'
The config file used is shown below.
My ESLint config
{
"root": true,
"env": {
"es6": true,
"node": true,
"browser": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": { "jsx": true },
"sourceType": "module"
},
"plugins": [
"react",
"import",
"unicorn",
"security",
"prettier",
"react-hooks",
"simple-import-sort",
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:unicorn/recommended",
"plugin:security/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
"prettier/unicorn",
"prettier/react"
],
"rules": {
"prefer-const": "error",
"react/prop-types": "off",
"simple-import-sort/sort": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/newline-after-import": "error",
"unicorn/prevent-abbreviations": "off",
"unicorn/consistent-function-scoping": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"babel-module": {}
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Formatting empty line between third party imports and other ...
Using the following eslint rule works: { "import/order": [ "error", { groups: [ ["builtin", "external"] ], "newlines-between": "always" } ...
Read more >How to remove carriage returns (line breaks) from cells in Excel
Select one or more cells where you want to delete line breaks. On your Excel ribbon, go to the Ablebits Data tab >...
Read more >re — Regular expression operations — Python 3.11.1 ...
The solution is to use Python's raw string notation for regular expression patterns; backslashes are not handled in any special way in a...
Read more >New line character for Descriptive fields in CSV Import
I am using Atom 2.0 instance and using the command line interface to perform the imports. We tried using the pipe "|" character...
Read more >Set hyphenation and line breaks in Illustrator - Adobe Support
You can prevent words from breaking at the end of lines—for example, proper names or words that could be misread when hyphenated. You...
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
@keemor Hi!
You need to put everything in the same array, like this:
(I didn’t test that before posting, so forgive me if I made a mistake 🙏)
This is now possible in v5.0.0 using custom grouping.
For example:
(Edited for newer version based on https://github.com/lydell/eslint-plugin-simple-import-sort/issues/25#issuecomment-1173143681)