eslint-plugin-turmag-special-rules 1.0.20 → 1.0.22

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
@@ -4,7 +4,7 @@ Special eslint rules for your awesome projects
4
4
 
5
5
  ## Installation
6
6
 
7
- You'll first need to install [ESLint](https://eslint.org/):
7
+ You'll first need to install [ESLint](https://eslint.org):
8
8
 
9
9
  ```sh
10
10
  npm i eslint --save-dev
@@ -39,7 +39,12 @@ module.exports = {
39
39
  messageId: 'column',
40
40
  fix: fixer => {
41
41
  const specifiersArr = [];
42
- node.specifiers.forEach(specifier => specifiersArr.push(specifier.local.name));
42
+ node.specifiers.forEach(specifier => {
43
+ const localName = specifier.local.name;
44
+
45
+ const name = specifier.importKind === 'type' ? `type ${localName}` : localName;
46
+ specifiersArr.push(name);
47
+ });
43
48
 
44
49
  const replaceShiftSign = '\n ';
45
50
  return fixer.replaceText(node, `import {${replaceShiftSign}${specifiersArr.join(`,${replaceShiftSign}`)},\n} from '${node.source.value}';`);
@@ -52,7 +57,12 @@ module.exports = {
52
57
  messageId: 'line',
53
58
  fix: fixer => {
54
59
  const specifiersArr = [];
55
- node.specifiers.forEach(specifier => specifiersArr.push(specifier.local.name));
60
+ node.specifiers.forEach(specifier => {
61
+ const localName = specifier.local.name;
62
+
63
+ const name = specifier.importKind === 'type' ? `type ${localName}` : localName;
64
+ specifiersArr.push(name);
65
+ });
56
66
 
57
67
  const replaceShiftSign = ' ';
58
68
  return fixer.replaceText(node, `import {${replaceShiftSign}${specifiersArr.join(`,${replaceShiftSign}`)} } from '${node.source.value}';`);
@@ -1,3 +1,8 @@
1
+ /**
2
+ * DEPRECATED!
3
+ * It's better to use rule sort-imports with custom groups from plugin eslint-plugin-perfectionist
4
+ */
5
+
1
6
  const entitiesOrder = ['external', 'vue', 'component', 'composable', 'store', 'mixin', 'type', 'constant', 'method', 'api'];
2
7
  const determineEntity = (value, specifiers) => {
3
8
  let entity = 'external';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-turmag-special-rules",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "type": "commonjs",
5
5
  "description": "Special eslint rules for your awesome projects",
6
6
  "keywords": [