How to handle the confliction with `import/first`?
See original GitHub issueThis is after the format:
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useShareAppMessage, useShareTimeline } from '@tarojs/taro';
import Table, { Columns } from 'taro-react-table';
import { useAppDispatch, useAppSelector } from '../../store/hooks';
import 'taro-react-table/dist/index.css'; // <----ESLint: Absolute imports should come before relative imports.(import/first)
import './index.scss';
My .eslintrc.js
module.exports = {
extends: ['taro/react', 'plugin:prettier/recommended'],
plugins: ['simple-import-sort', 'import'],
rules: {
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'import/order': 'off',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': 'warn',
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
},
overrides: [
// override "simple-import-sort" config
{
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
rules: {
'simple-import-sort/imports': [
'warn',
{
groups: [
[
// Packages `react` related packages come first.
'^react',
'^@?\\w',
// Internal packages.
'^(@|components)(/.*|$)',
// Side effect imports.
'^\\u0000',
// Parent imports. Put `..` last.
'^\\.\\.(?!/?$)',
'^\\.\\./?$',
// Other relative imports. Put same-folder imports and `.` last.
'^\\./(?=.*/)(?!/?$)',
'^\\.(?!/?$)',
'^\\./?$',
],
// Style imports.
['^.+\\.?(sc|sa|c)ss$'],
],
},
],
},
},
],
};
Note: taro/react
contains import/order
, so I turned the rule off.
Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How To Handle Workplace Conflict (With Tips and Examples)
How to handle conflict in the workplace · 1. Foster relationships with colleagues · 2. Communication is key · 3. Learn to listen...
Read more >Git merge conflicts | Atlassian Git Tutorial
The git merge command's primary responsibility is to combine separate branches and resolve any conflicting edits. Understanding merge conflicts. Merging and ...
Read more >7 Tips on How to Manage and Resolve Conflict in the Workplace
“Establishing conflict management processes in a company is fundamental as it helps reduce conflict instances among employees,'' says Casper Hansen, an expert ...
Read more >Resolving a merge conflict using the command line
You can resolve merge conflicts using the command line and a text editor. MacWindowsLinux. Merge conflicts occur when competing changes are made to...
Read more >Tips for Managing Conflict - Clarke University
Accept conflict. Remember that conflict is natural and happens in every ongoing relationship. Since conflict is unavoidable we must learn to manage it....
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
I fixed with
'import/first': ['warn', 'disable-absolute-first'],
oh, my wrong, the topic is incorrect. the
eslint-plugin-simple-import-sort
do put the absolute css to the last group, just theimport/first
throws warning…