@boehringer-ingelheim/eslint-config 5.1.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/README.md CHANGED
@@ -68,6 +68,7 @@ This shared ESLint configuration is set up for TypeScript projects that adhere t
68
68
  The following plugins are used in this configuration:
69
69
 
70
70
  - [`@typescript-eslint/eslint-plugin`](https://typescript-eslint.io/rules/)
71
+ - [`eslint-plugin-deprecation`](https://github.com/gund/eslint-plugin-deprecation)
71
72
  - [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import)
72
73
  - [`eslint-plugin-sonarjs`](https://github.com/SonarSource/eslint-plugin-sonarjs)
73
74
 
package/base/index.js CHANGED
@@ -1,10 +1,15 @@
1
- const { SORT_CLASSES_GROUPS, SORT_IMPORTS_GROUPS } = require('../lib/eslint-plugin-perfectionist');
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 = {
@@ -15,9 +20,10 @@ module.exports = {
15
20
  'eslint:recommended',
16
21
  'plugin:@typescript-eslint/recommended-type-checked',
17
22
  'plugin:@typescript-eslint/stylistic-type-checked',
23
+ 'plugin:deprecation/recommended',
18
24
  'plugin:import/recommended',
19
25
  'plugin:import/typescript',
20
- 'plugin:perfectionist/recommended-natural',
26
+ 'plugin:perfectionist/recommended-natural-legacy',
21
27
  'plugin:sonarjs/recommended-legacy',
22
28
  ],
23
29
  overrides: [
@@ -104,31 +110,44 @@ module.exports = {
104
110
  'import/no-named-as-default-member': 'off',
105
111
 
106
112
  // eslint-plugin-perfectionist: https://github.com/azat-io/eslint-plugin-perfectionist
107
- 'perfectionist/sort-array-includes': ['error', { 'ignore-case': true, type: 'natural' }],
108
- 'perfectionist/sort-astro-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
109
- 'perfectionist/sort-classes': ['error', { groups: SORT_CLASSES_GROUPS, 'ignore-case': true, type: 'natural' }],
110
- 'perfectionist/sort-enums': ['error', { 'ignore-case': true, type: 'natural' }],
111
- 'perfectionist/sort-exports': ['error', { 'ignore-case': true, type: 'natural' }],
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
+ ],
112
120
  'perfectionist/sort-imports': [
113
121
  'error',
114
122
  {
123
+ ...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-imports'][1],
115
124
  groups: SORT_IMPORTS_GROUPS,
116
- 'ignore-case': true,
117
- 'newlines-between': 'ignore',
118
- type: 'natural',
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,
119
149
  },
120
150
  ],
121
- 'perfectionist/sort-interfaces': ['error', { 'ignore-case': true, type: 'natural' }],
122
- 'perfectionist/sort-intersection-types': ['error', { 'ignore-case': true, type: 'natural' }],
123
- 'perfectionist/sort-jsx-props': ['error', { 'ignore-case': true, type: 'natural' }],
124
- 'perfectionist/sort-maps': ['error', { 'ignore-case': true, type: 'natural' }],
125
- 'perfectionist/sort-named-exports': ['error', { 'ignore-case': true, type: 'natural' }],
126
- 'perfectionist/sort-named-imports': ['error', { 'ignore-alias': true, 'ignore-case': true, type: 'natural' }],
127
- 'perfectionist/sort-object-types': ['error', { 'ignore-case': true, type: 'natural' }],
128
- 'perfectionist/sort-objects': ['error', { 'ignore-case': true, 'partition-by-comment': true, type: 'natural' }],
129
- 'perfectionist/sort-svelte-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
130
- 'perfectionist/sort-union-types': ['error', { 'ignore-case': true, type: 'natural' }],
131
- 'perfectionist/sort-vue-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
132
151
  },
133
152
  settings: {
134
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": "5.1.0-next.1",
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",
@@ -34,9 +34,10 @@
34
34
  "@typescript-eslint/eslint-plugin": "^7.17.0",
35
35
  "@typescript-eslint/parser": "^7.17.0",
36
36
  "eslint-import-resolver-typescript": "^3.6.1",
37
+ "eslint-plugin-deprecation": "^3.0.0",
37
38
  "eslint-plugin-import": "^2.29.1",
38
39
  "eslint-plugin-jsx-a11y": "^6.9.0",
39
- "eslint-plugin-perfectionist": "^2.11.0",
40
+ "eslint-plugin-perfectionist": "^3.0.0",
40
41
  "eslint-plugin-playwright": "^1.6.2",
41
42
  "eslint-plugin-react": "^7.35.0",
42
43
  "eslint-plugin-react-hooks": "^4.6.2",