eslint-plugin-perfectionist 4.12.1 → 4.12.3

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.
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
3
3
  const name = 'eslint-plugin-perfectionist'
4
- const version = '4.12.1'
4
+ const version = '4.12.3'
5
5
  exports.name = name
6
6
  exports.version = version
@@ -7,7 +7,6 @@ const validateSideEffectsConfiguration = require('./sort-imports/validate-side-e
7
7
  const validateCustomSortConfiguration = require('../utils/validate-custom-sort-configuration.js')
8
8
  const getCustomGroupsCompareOptions = require('../utils/get-custom-groups-compare-options.js')
9
9
  const readClosestTsConfigByPath = require('./sort-imports/read-closest-ts-config-by-path.js')
10
- const validateGroupsConfiguration = require('../utils/validate-groups-configuration.js')
11
10
  const getOptionsWithCleanGroups = require('../utils/get-options-with-clean-groups.js')
12
11
  const computeCommonSelectors = require('./sort-imports/compute-common-selectors.js')
13
12
  const isSideEffectOnlyGroup = require('./sort-imports/is-side-effect-only-group.js')
@@ -60,36 +59,19 @@ const sortImports = createEslintRule.createEslintRule({
60
59
  order: 'asc',
61
60
  }),
62
61
  )
63
- if (Array.isArray(options.customGroups)) {
64
- validateGeneratedGroupsConfiguration.validateGeneratedGroupsConfiguration(
65
- {
66
- options: {
67
- ...options,
68
- customGroups: options.customGroups,
69
- },
70
- selectors: [...types.allSelectors, ...types.allDeprecatedSelectors],
71
- modifiers: types.allModifiers,
72
- },
73
- )
74
- } else {
75
- let generatedGroups = generatePredefinedGroups.generatePredefinedGroups({
76
- cache: cachedGroupsByModifiersAndSelectors,
77
- selectors: types.allSelectors,
78
- modifiers: types.allModifiers,
79
- })
80
- validateGroupsConfiguration.validateGroupsConfiguration({
81
- allowedCustomGroups: [
82
- ...Object.keys(options.customGroups.type ?? {}),
83
- ...Object.keys(options.customGroups.value ?? {}),
84
- ],
85
- allowedPredefinedGroups: [
86
- ...generatedGroups,
87
- ...types.allDeprecatedSelectors,
88
- 'unknown',
89
- ],
90
- options,
91
- })
92
- }
62
+ validateGeneratedGroupsConfiguration.validateGeneratedGroupsConfiguration({
63
+ options: {
64
+ ...options,
65
+ customGroups: Array.isArray(options.customGroups)
66
+ ? options.customGroups
67
+ : {
68
+ ...options.customGroups.type,
69
+ ...options.customGroups.value,
70
+ },
71
+ },
72
+ selectors: [...types.allSelectors, ...types.allDeprecatedSelectors],
73
+ modifiers: types.allModifiers,
74
+ })
93
75
  validateCustomSortConfiguration.validateCustomSortConfiguration(options)
94
76
  validateNewlinesAndPartitionConfiguration.validateNewlinesAndPartitionConfiguration(
95
77
  options,
@@ -419,7 +401,6 @@ const sortImports = createEslintRule.createEslintRule({
419
401
  maxLineLength: ['type'],
420
402
  },
421
403
  additionalProperties: false,
422
- id: 'sort-imports',
423
404
  type: 'object',
424
405
  },
425
406
  definitions: {
@@ -445,6 +426,7 @@ const sortImports = createEslintRule.createEslintRule({
445
426
  type: 'object',
446
427
  },
447
428
  },
429
+ id: 'sort-imports',
448
430
  uniqueItems: true,
449
431
  type: 'array',
450
432
  },
@@ -35,7 +35,6 @@ let isPartitionComment = ({ partitionByComment, comment }) => {
35
35
  relevantPartitionByComment = partitionByComment.line
36
36
  }
37
37
  return (
38
- // eslint-disable-next-line no-undefined
39
38
  relevantPartitionByComment !== void 0 &&
40
39
  isTrimmedCommentPartitionComment({
41
40
  partitionByComment: relevantPartitionByComment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-perfectionist",
3
- "version": "4.12.1",
3
+ "version": "4.12.3",
4
4
  "description": "ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.",
5
5
  "keywords": [
6
6
  "eslint",