@boehringer-ingelheim/eslint-config 6.0.0-next.1 → 6.0.0-next.2
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/base/index.js +39 -21
- package/lib/eslint-plugin-perfectionist.js +21 -0
- package/package.json +2 -2
package/base/index.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {
|
|
2
|
+
SORT_CLASSES_GROUPS,
|
|
3
|
+
SORT_IMPORTS_GROUPS,
|
|
4
|
+
SORT_INTERSECTION_TYPES_GROUPS,
|
|
5
|
+
} = require('../lib/eslint-plugin-perfectionist');
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* Workaround to allow ESLint to resolve plugins that were installed
|
|
5
9
|
* by an external config, see https://github.com/eslint/eslint/issues/3458.
|
|
6
10
|
*/
|
|
7
11
|
require('@rushstack/eslint-patch/modern-module-resolution');
|
|
12
|
+
const eslintPluginPerfectionist = require('eslint-plugin-perfectionist');
|
|
8
13
|
|
|
9
14
|
/** @type {import('eslint').ESLint.ConfigData & { parserOptions: import('eslint').ESLint.ConfigData['parserOptions'] & import('@typescript-eslint/parser').ParserOptions } } */
|
|
10
15
|
module.exports = {
|
|
@@ -18,7 +23,7 @@ module.exports = {
|
|
|
18
23
|
'plugin:deprecation/recommended',
|
|
19
24
|
'plugin:import/recommended',
|
|
20
25
|
'plugin:import/typescript',
|
|
21
|
-
'plugin:perfectionist/recommended-natural',
|
|
26
|
+
'plugin:perfectionist/recommended-natural-legacy',
|
|
22
27
|
'plugin:sonarjs/recommended-legacy',
|
|
23
28
|
],
|
|
24
29
|
overrides: [
|
|
@@ -105,31 +110,44 @@ module.exports = {
|
|
|
105
110
|
'import/no-named-as-default-member': 'off',
|
|
106
111
|
|
|
107
112
|
// eslint-plugin-perfectionist: https://github.com/azat-io/eslint-plugin-perfectionist
|
|
108
|
-
'perfectionist/sort-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
'perfectionist/sort-classes': [
|
|
114
|
+
'error',
|
|
115
|
+
{
|
|
116
|
+
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-classes'][1],
|
|
117
|
+
groups: SORT_CLASSES_GROUPS,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
113
120
|
'perfectionist/sort-imports': [
|
|
114
121
|
'error',
|
|
115
122
|
{
|
|
123
|
+
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-imports'][1],
|
|
116
124
|
groups: SORT_IMPORTS_GROUPS,
|
|
117
|
-
'ignore
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
newlinesBetween: 'ignore',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
'perfectionist/sort-intersection-types': [
|
|
129
|
+
'error',
|
|
130
|
+
{
|
|
131
|
+
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules[
|
|
132
|
+
'perfectionist/sort-intersection-types'
|
|
133
|
+
][1],
|
|
134
|
+
groups: SORT_INTERSECTION_TYPES_GROUPS,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
'perfectionist/sort-named-imports': [
|
|
138
|
+
'error',
|
|
139
|
+
{
|
|
140
|
+
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-named-imports'][1],
|
|
141
|
+
ignoreAlias: true,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
'perfectionist/sort-objects': [
|
|
145
|
+
'error',
|
|
146
|
+
{
|
|
147
|
+
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-objects'][1],
|
|
148
|
+
partitionByComment: true,
|
|
120
149
|
},
|
|
121
150
|
],
|
|
122
|
-
'perfectionist/sort-interfaces': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
123
|
-
'perfectionist/sort-intersection-types': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
124
|
-
'perfectionist/sort-jsx-props': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
125
|
-
'perfectionist/sort-maps': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
126
|
-
'perfectionist/sort-named-exports': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
127
|
-
'perfectionist/sort-named-imports': ['error', { 'ignore-alias': true, 'ignore-case': true, type: 'natural' }],
|
|
128
|
-
'perfectionist/sort-object-types': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
129
|
-
'perfectionist/sort-objects': ['error', { 'ignore-case': true, 'partition-by-comment': true, type: 'natural' }],
|
|
130
|
-
'perfectionist/sort-svelte-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
131
|
-
'perfectionist/sort-union-types': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
132
|
-
'perfectionist/sort-vue-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
|
|
133
151
|
},
|
|
134
152
|
settings: {
|
|
135
153
|
'import/resolver': {
|
|
@@ -35,7 +35,28 @@ const SORT_CLASSES_GROUPS = [
|
|
|
35
35
|
'unknown',
|
|
36
36
|
];
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* This array can be used to configure the perfectionist/sort-intersection-types rule.
|
|
40
|
+
* The following group names are available for configuration: https://perfectionist.dev/rules/sort-intersection-types#groups
|
|
41
|
+
*/
|
|
42
|
+
const SORT_INTERSECTION_TYPES_GROUPS = [
|
|
43
|
+
'conditional',
|
|
44
|
+
'function',
|
|
45
|
+
'import',
|
|
46
|
+
'interseciont',
|
|
47
|
+
'union',
|
|
48
|
+
'named',
|
|
49
|
+
'keyword',
|
|
50
|
+
'literal',
|
|
51
|
+
'operator',
|
|
52
|
+
'tuple',
|
|
53
|
+
'object',
|
|
54
|
+
'nullish',
|
|
55
|
+
'unknown',
|
|
56
|
+
];
|
|
57
|
+
|
|
38
58
|
module.exports = {
|
|
39
59
|
SORT_CLASSES_GROUPS,
|
|
40
60
|
SORT_IMPORTS_GROUPS,
|
|
61
|
+
SORT_INTERSECTION_TYPES_GROUPS,
|
|
41
62
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boehringer-ingelheim/eslint-config",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.2",
|
|
4
4
|
"description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boehringer",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
38
38
|
"eslint-plugin-import": "^2.29.1",
|
|
39
39
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
40
|
-
"eslint-plugin-perfectionist": "^
|
|
40
|
+
"eslint-plugin-perfectionist": "^3.0.0",
|
|
41
41
|
"eslint-plugin-playwright": "^1.6.2",
|
|
42
42
|
"eslint-plugin-react": "^7.35.0",
|
|
43
43
|
"eslint-plugin-react-hooks": "^4.6.2",
|