@cenk1cenk2/eslint-config 2.5.4 → 2.5.5
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 +7 -0
- package/constants.js +3 -0
- package/import-strict.js +12 -4
- package/import.js +43 -36
- package/package.json +1 -1
- package/utils.js +17 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.5.5](https://github.com/cenk1cenk2/eslint-config/compare/v2.5.4...v2.5.5) (2022-02-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update ([1ae486c](https://github.com/cenk1cenk2/eslint-config/commit/1ae486c8c3d3f83c6ed1e4e8199b1b41f7b29e2d))
|
|
7
|
+
|
|
1
8
|
## [2.5.4](https://github.com/cenk1cenk2/eslint-config/compare/v2.5.3...v2.5.4) (2022-02-01)
|
|
2
9
|
|
|
3
10
|
|
package/constants.js
ADDED
package/import-strict.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
const { ALL_KNOWN_JAVASCRIPT_FILE_EXTENSIONS } = require('./constants')
|
|
2
|
+
|
|
1
3
|
/** @type {import("eslint").Linter.Config} */
|
|
2
4
|
module.exports = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
overrides: [
|
|
6
|
+
{
|
|
7
|
+
files: ALL_KNOWN_JAVASCRIPT_FILE_EXTENSIONS,
|
|
8
|
+
plugins: [ 'import' ],
|
|
9
|
+
rules: {
|
|
10
|
+
'import/no-extraneous-dependencies': 'error',
|
|
11
|
+
'import/exports-last': 'error'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
7
15
|
}
|
package/import.js
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
|
+
const { ALL_KNOWN_JAVASCRIPT_FILE_EXTENSIONS } = require('./constants')
|
|
2
|
+
|
|
1
3
|
/** @type {import("eslint").Linter.Config} */
|
|
2
4
|
module.exports = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
overrides: [
|
|
6
|
+
{
|
|
7
|
+
files: ALL_KNOWN_JAVASCRIPT_FILE_EXTENSIONS,
|
|
8
|
+
plugins: [ 'import' ],
|
|
9
|
+
rules: {
|
|
10
|
+
'sort-imports': 'off',
|
|
11
|
+
'import/first': 'error',
|
|
12
|
+
'import/newline-after-import': 'error',
|
|
13
|
+
'import/no-duplicates': 'error',
|
|
14
|
+
'import/order': [
|
|
15
|
+
'error',
|
|
13
16
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
pathGroups: [
|
|
18
|
+
{
|
|
19
|
+
pattern: '@{cenk1cenk2,cenk1cenk2-*}/**',
|
|
20
|
+
group: 'index'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
pattern: '@{src,interfaces,utils,constants,commands}/**',
|
|
24
|
+
group: 'index'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
pattern: '@{src,interfaces,utils,constants,commands}',
|
|
28
|
+
group: 'index'
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
pathGroupsExcludedImportTypes: [ 'builtin' ],
|
|
32
|
+
groups: [
|
|
33
|
+
[ 'builtin', 'external' ],
|
|
34
|
+
[ 'index', 'parent', 'sibling' ]
|
|
35
|
+
],
|
|
36
|
+
'newlines-between': 'always',
|
|
37
|
+
alphabetize: {
|
|
38
|
+
order: 'asc',
|
|
39
|
+
caseInsensitive: true
|
|
40
|
+
}
|
|
24
41
|
}
|
|
25
42
|
],
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
],
|
|
31
|
-
'newlines-between': 'always',
|
|
32
|
-
alphabetize: {
|
|
33
|
-
order: 'asc',
|
|
34
|
-
caseInsensitive: true
|
|
35
|
-
}
|
|
43
|
+
'import/export': 'error',
|
|
44
|
+
'import/no-extraneous-dependencies': 'error',
|
|
45
|
+
'import/no-self-import': 'error',
|
|
46
|
+
'import/no-useless-path-segments': 'error'
|
|
36
47
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'import/no-extraneous-dependencies': 'error',
|
|
40
|
-
'import/no-self-import': 'error',
|
|
41
|
-
'import/no-useless-path-segments': 'error'
|
|
42
|
-
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
43
50
|
}
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const { loadTsConfig } = require('load-tsconfig')
|
|
2
2
|
|
|
3
|
+
const { ALL_KNOWN_JAVASCRIPT_FILE_EXTENSIONS } = require('./constants')
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* @param {{ paths?: string[] tsconfig?: string, tsconfigDir?: string}} options
|
|
5
7
|
* @returns {import("eslint").Linter.Config['rules']}
|
|
@@ -68,4 +70,18 @@ function generateImportGroups (options) {
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
/**
|
|
74
|
+
* @param {{ paths?: string[] tsconfig?: string, tsconfigDir?: string}} options
|
|
75
|
+
* @returns {import("eslint").Linter.Config['overrides']}
|
|
76
|
+
*/
|
|
77
|
+
function generateImportGroupsWithOverride (options) {
|
|
78
|
+
return [
|
|
79
|
+
{
|
|
80
|
+
files: ALL_KNOWN_JAVASCRIPT_FILE_EXTENSIONS,
|
|
81
|
+
plugins: [ 'import' ],
|
|
82
|
+
rules: generateImportGroups(options)
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
module.exports = { generateImportGroups, generateImportGroupsWithOverride }
|