eslint-plugin-perfectionist 2.9.0 → 2.10.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.
@@ -152,7 +152,8 @@ const sortImports = createEslintRule.createEslintRule({
152
152
  options.groups = [...options.groups, "unknown"];
153
153
  }
154
154
  let nodes = [];
155
- let isSideEffectImport = (node) => node.type === "ImportDeclaration" && node.specifiers.length === 0;
155
+ let isSideEffectImport = (node) => node.type === "ImportDeclaration" && node.specifiers.length === 0 && /* Avoid matching on named imports without specifiers */
156
+ !/}\s*from\s+/.test(context.sourceCode.getText(node));
156
157
  let computeGroup = (node) => {
157
158
  let isStyle = (value) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
158
159
  (extension) => value.endsWith(extension)
@@ -150,7 +150,8 @@ const sortImports = createEslintRule({
150
150
  options.groups = [...options.groups, "unknown"];
151
151
  }
152
152
  let nodes = [];
153
- let isSideEffectImport = (node) => node.type === "ImportDeclaration" && node.specifiers.length === 0;
153
+ let isSideEffectImport = (node) => node.type === "ImportDeclaration" && node.specifiers.length === 0 && /* Avoid matching on named imports without specifiers */
154
+ !/}\s*from\s+/.test(context.sourceCode.getText(node));
154
155
  let computeGroup = (node) => {
155
156
  let isStyle = (value) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
156
157
  (extension) => value.endsWith(extension)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-perfectionist",
3
3
  "description": "ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.",
4
- "version": "2.9.0",
4
+ "version": "2.10.0",
5
5
  "homepage": "https://eslint-plugin-perfectionist.azat.io",
6
6
  "repository": "https://github.com/azat-io/eslint-plugin-perfectionist",
7
7
  "author": "Azat S. <to@azat.io>",
@@ -59,7 +59,7 @@
59
59
  "vue-eslint-parser": ">=9.0.0"
60
60
  },
61
61
  "dependencies": {
62
- "@typescript-eslint/utils": "^6.13.0",
62
+ "@typescript-eslint/utils": "^6.13.0 || ^7.0.0",
63
63
  "minimatch": "^9.0.3",
64
64
  "natural-compare-lite": "^1.4.0"
65
65
  }