@cenk1cenk2/eslint-config 2.5.0 → 2.5.4

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [2.5.4](https://github.com/cenk1cenk2/eslint-config/compare/v2.5.3...v2.5.4) (2022-02-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update function ([1f44e37](https://github.com/cenk1cenk2/eslint-config/commit/1f44e37062366c67ea001c86f8be3ebc4d3f0eb9))
7
+ * update utils ([3beeab4](https://github.com/cenk1cenk2/eslint-config/commit/3beeab4756c1a517e9d65e4137f0e041daee70c1))
8
+
9
+ ## [2.5.3](https://github.com/cenk1cenk2/eslint-config/compare/v2.5.2...v2.5.3) (2022-02-01)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * allowed groups ([2e5a615](https://github.com/cenk1cenk2/eslint-config/commit/2e5a615d1918059f52f1f2bc29e709779194f844))
15
+
16
+ ## [2.5.2](https://github.com/cenk1cenk2/eslint-config/compare/v2.5.1...v2.5.2) (2022-02-01)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * use flat arrays ([c78b8c6](https://github.com/cenk1cenk2/eslint-config/commit/c78b8c6b8d98e44b1c2cf0c6aa8a7f088c285e06))
22
+
23
+ ## [2.5.1](https://github.com/cenk1cenk2/eslint-config/compare/v2.5.0...v2.5.1) (2022-02-01)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * try with flatmap ([956c3a4](https://github.com/cenk1cenk2/eslint-config/commit/956c3a496ea786540377655af3d4ec8a71622470))
29
+
1
30
  # [2.5.0](https://github.com/cenk1cenk2/eslint-config/compare/v2.4.0...v2.5.0) (2022-02-01)
2
31
 
3
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/eslint-config",
3
- "version": "2.5.0",
3
+ "version": "2.5.4",
4
4
  "description": "Eslint configuration for my taste.",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/cenk1cenk2/eslint-config",
@@ -4,10 +4,10 @@ const { loadTsConfig } = require('load-tsconfig')
4
4
  * @param {{ paths?: string[] tsconfig?: string, tsconfigDir?: string}} options
5
5
  * @returns {import("eslint").Linter.Config['rules']}
6
6
  */
7
- function generateImportPluginGroupCases (options) {
7
+ function generateImportGroups (options) {
8
8
  const defaults = [ '@cenk1cenk2', '@cenk1cenk2-*' ]
9
9
 
10
- options.paths = options.paths ? options.paths.push(...defaults) : defaults
10
+ options.paths = Array.isArray(options.paths) ? [ ...options.paths, ...defaults ] : defaults
11
11
 
12
12
  /** @type {string[]} */
13
13
  let tsConfigPaths = []
@@ -27,32 +27,36 @@ function generateImportPluginGroupCases (options) {
27
27
  'error',
28
28
  {
29
29
  pathGroups: [
30
- ...options.paths.map((path) => {
30
+ ...options.paths.reduce((o, path) => {
31
31
  return [
32
+ ...o,
33
+
32
34
  {
33
35
  pattern: `${path}/**`,
34
- group: 'internal'
36
+ group: 'index'
35
37
  },
36
38
 
37
39
  {
38
40
  pattern: `${path}`,
39
- group: 'internal'
41
+ group: 'index'
40
42
  }
41
43
  ]
42
- }),
43
- ...tsConfigPaths.map((path) => {
44
+ }, []),
45
+ ...tsConfigPaths.reduce((o, path) => {
44
46
  return [
47
+ ...o,
48
+
45
49
  {
46
50
  pattern: `${path}`,
47
- group: 'internal'
51
+ group: 'index'
48
52
  }
49
53
  ]
50
- })
54
+ }, [])
51
55
  ],
52
56
  pathGroupsExcludedImportTypes: [ 'builtin' ],
53
57
  groups: [
54
58
  [ 'builtin', 'external' ],
55
- [ 'internal', 'index', 'parent', 'sibling' ]
59
+ [ 'index', 'parent', 'sibling' ]
56
60
  ],
57
61
  'newlines-between': 'always',
58
62
  alphabetize: {
@@ -64,4 +68,4 @@ function generateImportPluginGroupCases (options) {
64
68
  }
65
69
  }
66
70
 
67
- module.exports = generateImportPluginGroupCases
71
+ module.exports = { generateImportGroups }