@boehringer-ingelheim/eslint-config 9.3.0-perfectionist-v5.1 → 9.3.0
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/README.md +5 -13
- package/configs/base.js +5 -5
- package/configs/react.js +5 -6
- package/lib/eslint-plugin-perfectionist.js +10 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -326,19 +326,11 @@ npm run repair
|
|
|
326
326
|
|
|
327
327
|
### Release
|
|
328
328
|
|
|
329
|
-
|
|
329
|
+
> [!IMPORTANT]
|
|
330
|
+
> Manual releases are not supported to ensure consistency and security, see: <https://docs.npmjs.com/trusted-publishers>
|
|
330
331
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
Make sure that the secrets `GITHUB_TOKEN` and `NPM_TOKEN` are available in GitHub repository.
|
|
334
|
-
|
|
335
|
-
```sh
|
|
336
|
-
npm run release:ci
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
#### Manual Release
|
|
340
|
-
|
|
341
|
-
Make sure that the environment variables `GITHUB_TOKEN` and `NPM_TOKEN` are set or declared in `.env` and a productive build was previously created via `npm run build`.
|
|
332
|
+
Releases are automated through GitHub Actions using [semantic-release](https://github.com/semantic-release).
|
|
333
|
+
It bumps the version according to conventional commits, publishes the package to npm and release a new version to GitHub.
|
|
342
334
|
|
|
343
335
|
```sh
|
|
344
336
|
npm run release
|
|
@@ -357,7 +349,7 @@ Give a ⭐️ if this project helped you!
|
|
|
357
349
|
|
|
358
350
|
## License
|
|
359
351
|
|
|
360
|
-
Copyright ©
|
|
352
|
+
Copyright © 2026 [Boehringer Ingelheim](https://github.com/boehringer-ingelheim).
|
|
361
353
|
This project is [MIT](https://github.com/boehringer-ingelheim/eslint-config/blob/master/LICENSE) licensed.
|
|
362
354
|
|
|
363
355
|
## Resources
|
package/configs/base.js
CHANGED
|
@@ -6,6 +6,7 @@ const { defineConfig } = require('eslint/config');
|
|
|
6
6
|
const tseslint = require('typescript-eslint');
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
+
PERFECTIONIST_SETTINGS,
|
|
9
10
|
SORT_CLASSES_GROUPS,
|
|
10
11
|
SORT_IMPORTS_GROUPS,
|
|
11
12
|
SORT_INTERSECTION_TYPES_GROUPS,
|
|
@@ -93,35 +94,31 @@ module.exports = defineConfig(
|
|
|
93
94
|
'perfectionist/sort-classes': [
|
|
94
95
|
'error',
|
|
95
96
|
{
|
|
96
|
-
...perfectionist.configs['recommended-natural'].rules['perfectionist/sort-classes'][1],
|
|
97
97
|
groups: SORT_CLASSES_GROUPS,
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
100
|
'perfectionist/sort-imports': [
|
|
101
101
|
'error',
|
|
102
102
|
{
|
|
103
|
-
...perfectionist.configs['recommended-natural'].rules['perfectionist/sort-imports'][1],
|
|
104
103
|
groups: SORT_IMPORTS_GROUPS,
|
|
104
|
+
newlinesBetween: 0, // No newlines are allowed between groups
|
|
105
105
|
},
|
|
106
106
|
],
|
|
107
107
|
'perfectionist/sort-intersection-types': [
|
|
108
108
|
'error',
|
|
109
109
|
{
|
|
110
|
-
...perfectionist.configs['recommended-natural'].rules['perfectionist/sort-intersection-types'][1],
|
|
111
110
|
groups: SORT_INTERSECTION_TYPES_GROUPS,
|
|
112
111
|
},
|
|
113
112
|
],
|
|
114
113
|
'perfectionist/sort-named-imports': [
|
|
115
114
|
'error',
|
|
116
115
|
{
|
|
117
|
-
...perfectionist.configs['recommended-natural'].rules['perfectionist/sort-named-imports'][1],
|
|
118
116
|
ignoreAlias: true,
|
|
119
117
|
},
|
|
120
118
|
],
|
|
121
119
|
'perfectionist/sort-objects': [
|
|
122
120
|
'error',
|
|
123
121
|
{
|
|
124
|
-
...perfectionist.configs['recommended-natural'].rules['perfectionist/sort-objects'][1],
|
|
125
122
|
partitionByComment: true,
|
|
126
123
|
},
|
|
127
124
|
],
|
|
@@ -130,6 +127,9 @@ module.exports = defineConfig(
|
|
|
130
127
|
'import/resolver': {
|
|
131
128
|
typescript: true,
|
|
132
129
|
},
|
|
130
|
+
perfectionist: {
|
|
131
|
+
...PERFECTIONIST_SETTINGS,
|
|
132
|
+
},
|
|
133
133
|
},
|
|
134
134
|
},
|
|
135
135
|
{
|
package/configs/react.js
CHANGED
|
@@ -4,8 +4,7 @@ const reactHooks = require('eslint-plugin-react-hooks');
|
|
|
4
4
|
const reactRefresh = require('eslint-plugin-react-refresh');
|
|
5
5
|
const { defineConfig } = require('eslint/config');
|
|
6
6
|
const globals = require('globals');
|
|
7
|
-
|
|
8
|
-
const { SORT_IMPORTS_GROUPS } = require('../lib/eslint-plugin-perfectionist.js');
|
|
7
|
+
const { PERFECTIONIST_SETTINGS, SORT_IMPORTS_GROUPS } = require('../lib/eslint-plugin-perfectionist.js');
|
|
9
8
|
const base = require('./base.js');
|
|
10
9
|
|
|
11
10
|
module.exports = defineConfig(
|
|
@@ -67,8 +66,7 @@ module.exports = defineConfig(
|
|
|
67
66
|
},
|
|
68
67
|
],
|
|
69
68
|
groups: ['react', ...SORT_IMPORTS_GROUPS],
|
|
70
|
-
|
|
71
|
-
type: 'natural',
|
|
69
|
+
newlinesBetween: 0, // No newlines are allowed between groups
|
|
72
70
|
},
|
|
73
71
|
],
|
|
74
72
|
'perfectionist/sort-jsx-props': [
|
|
@@ -85,8 +83,6 @@ module.exports = defineConfig(
|
|
|
85
83
|
},
|
|
86
84
|
],
|
|
87
85
|
groups: ['reservedProps', 'unknown', 'callback'],
|
|
88
|
-
ignoreCase: true,
|
|
89
|
-
type: 'natural',
|
|
90
86
|
},
|
|
91
87
|
],
|
|
92
88
|
|
|
@@ -103,6 +99,9 @@ module.exports = defineConfig(
|
|
|
103
99
|
],
|
|
104
100
|
},
|
|
105
101
|
settings: {
|
|
102
|
+
perfectionist: {
|
|
103
|
+
...PERFECTIONIST_SETTINGS,
|
|
104
|
+
},
|
|
106
105
|
react: {
|
|
107
106
|
version: 'detect',
|
|
108
107
|
},
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opinionated 'default' settings for eslint-plugin-perfectionist.
|
|
3
|
+
* @see https://perfectionist.dev/guide/getting-started#settings
|
|
4
|
+
*/
|
|
5
|
+
const PERFECTIONIST_SETTINGS = {
|
|
6
|
+
ignoreCase: true, // Ignore case when sorting
|
|
7
|
+
type: 'natural',
|
|
8
|
+
};
|
|
9
|
+
|
|
1
10
|
/**
|
|
2
11
|
* While the sorting of imports is done by `eslint-plugin-perfectionist/sort-imports`,
|
|
3
12
|
* the order and grouping of imports is still taken from the previous configuration of `eslint-plugin-import/order`,
|
|
@@ -71,6 +80,7 @@ const SORT_INTERSECTION_TYPES_GROUPS = [
|
|
|
71
80
|
];
|
|
72
81
|
|
|
73
82
|
module.exports = {
|
|
83
|
+
PERFECTIONIST_SETTINGS,
|
|
74
84
|
SORT_CLASSES_GROUPS,
|
|
75
85
|
SORT_IMPORTS_GROUPS,
|
|
76
86
|
SORT_INTERSECTION_TYPES_GROUPS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boehringer-ingelheim/eslint-config",
|
|
3
|
-
"version": "9.3.0
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boehringer",
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
"types": "index.d.ts",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"prepare": "husky",
|
|
34
|
-
"release": "
|
|
35
|
-
"release:ci": "semantic-release",
|
|
34
|
+
"release": "semantic-release",
|
|
36
35
|
"repair": "npx --yes rimraf@6 .git/hooks node_modules package-lock.json && npm install",
|
|
37
36
|
"lint": "eslint ."
|
|
38
37
|
},
|