@viclafouch/eslint-config-viclafouch 4.1.1-beta.0 → 4.1.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rules/imports.js +32 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viclafouch/eslint-config-viclafouch",
3
- "version": "4.1.1-beta.0",
3
+ "version": "4.1.1-beta.1",
4
4
  "description": "ESLint and Prettier Config from Victor de la Fouchardiere",
5
5
  "main": "index.js",
6
6
  "keywords": [
package/rules/imports.js CHANGED
@@ -7,11 +7,41 @@ module.exports = {
7
7
  },
8
8
  plugins: ['simple-import-sort', 'import'],
9
9
  rules: {
10
- 'simple-import-sort/imports': 'error',
11
10
  'simple-import-sort/exports': 'error',
12
11
  'import/first': 'error',
13
12
  'import/newline-after-import': 'error',
14
- 'import/no-duplicates': 'error'
13
+ 'import/no-duplicates': 'error',
14
+ 'simple-import-sort/imports': [
15
+ 'error',
16
+ {
17
+ groups: [
18
+ [
19
+ // Anything that starts with react
20
+ // e.g: import { useState } from 'react'
21
+ // e.g: import { useFela } from 'react-fela'
22
+ '^react',
23
+ // Anything that starts with next
24
+ // e.g: import { useRouter } from 'next/router'
25
+ '^next',
26
+ // Anything that starts with a letter
27
+ // e.g: import Downshift from 'downshift'
28
+ '^[a-z]',
29
+ // Anything that starts with @
30
+ // e.g: import { yupResolver } from '@hookform/resolvers/yup'
31
+ '^@',
32
+ // Anything that starts with a dot
33
+ // e.g: import { matchIsDate } from './utils/date
34
+ '^\\.',
35
+ // Side effect imports from lib
36
+ // e.g: import 'react-toastify/dist/ReactToastify.css'
37
+ '^\\u0000',
38
+ // Side effect import that starts with a dot
39
+ // e.g: import './setup-config'
40
+ '^\\u0000\\.'
41
+ ]
42
+ ]
43
+ }
44
+ ]
15
45
  },
16
46
  settings: {
17
47
  'import/resolver': {