@bigbinary/eslint-plugin-neeto 1.1.11 → 1.1.13

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -461,7 +461,7 @@
461
461
  return "Use \"".concat(functionName, "\" from \"@bigbinary/neeto-commons-frontend/").concat(utilType, "\" instead. Refer: ").concat(url);
462
462
  };
463
463
  var suggestCommonConstants = function suggestCommonConstants(constantName, repository) {
464
- return "Use \"".concat(constantName, "\" from \"@bigbinary/").concat(repository, "/constants\"");
464
+ return "Use \"".concat(constantName, "\" from \"@bigbinary/").concat(repository, "\"");
465
465
  };
466
466
  var addRequiredPeerDependencies$1 = function addRequiredPeerDependencies(packageName) {
467
467
  return "".concat(packageName, " should be added to peerDependencies");
@@ -525,6 +525,7 @@
525
525
  var DIFFERENT_PROPS_MUST_BE_OUTSIDE = "Props with different key and value should be outside the spread attribute";
526
526
  var PROP_KEY_VALUE_DUPLICATE = "Prop key and value names should not be repeated";
527
527
  var USE_WITH_IMMUTABLE_ACTIONS_WRAPPER = 'Use "withImmutableActions" wrapper from "neeto-commons-frontend" inside zustand create. Refer: https://bit.ly/withimmutableactions';
528
+ var USE_WITH_T_HOC_IN_DUMB_COMPONENTS = 'Use "withT" HOC from "neeto-commons-frontend" instead of useTranslation hook in Dumb components';
528
529
 
529
530
  var PACKAGES_TO_CHECK = ["@bigbinary/neeto-molecules", "@bigbinary/neetoui", "@bigbinary/neeto-commons-frontend"];
530
531
 
@@ -5957,7 +5958,7 @@
5957
5958
  if (hasHooksOtherThanTranslationHook) return;
5958
5959
  context.report({
5959
5960
  node: node,
5960
- message: "Use withT HOC instead of useTranslation hook",
5961
+ message: USE_WITH_T_HOC_IN_DUMB_COMPONENTS,
5961
5962
  fix: function fix(fixer) {
5962
5963
  var fixers = [];
5963
5964
  var _arrowFunctionExpress = _toArray(arrowFunctionExpression.params),
@@ -8096,8 +8097,8 @@
8096
8097
  };
8097
8098
 
8098
8099
  var IMPORT_SOURCES = {
8099
- "neeto-commons-frontend": "neetocommons/constants",
8100
- "neeto-team-members-frontend": "neetoteam/constants"
8100
+ "neeto-commons-frontend/constants": ["neetocommons/constants", "@bigbinary/neeto-commons-frontend/constants"],
8101
+ "neeto-team-members-frontend": ["neetoteam", "@bigbinary/neeto-team-members-frontend"]
8101
8102
  };
8102
8103
  var TRANSLATION_VERBS_PATTERN = {
8103
8104
  type: TYPES.OBJECT_EXPRESSION,
@@ -8128,7 +8129,9 @@
8128
8129
  },
8129
8130
  source: {
8130
8131
  type: TYPES.LITERAL,
8131
- value: IMPORT_SOURCES[repository]
8132
+ value: function value(_value2) {
8133
+ return ramda.includes(_value2, IMPORT_SOURCES[repository]);
8134
+ }
8132
8135
  }
8133
8136
  };
8134
8137
  };
@@ -8185,14 +8188,14 @@
8185
8188
  var checkTranslationVerbs = function checkTranslationVerbs(node, context) {
8186
8189
  var _parentNode$callee;
8187
8190
  var parentNode = node.parent;
8188
- var repository = "neeto-commons-frontend";
8191
+ var repository = "neeto-commons-frontend/constants";
8189
8192
  var isCommonConstant = parentNode.type === TYPES.VARIABLE_DECLARATOR ? pure.matches(TRANSLATION_VERBS_PATTERN, parentNode.init) : ((_parentNode$callee = parentNode.callee) === null || _parentNode$callee === void 0 ? void 0 : _parentNode$callee.name) === "t" && !pure.existsBy(constantImportPattern(node.name, repository), getAllImports(node));
8190
8193
  if (isCommonConstant) {
8191
8194
  reportIssue({
8192
8195
  node: node,
8193
8196
  repository: repository,
8194
8197
  context: context,
8195
- constantName: "TRANSLATION_".concat(node.name)
8198
+ constantName: node.name
8196
8199
  });
8197
8200
  }
8198
8201
  };
@@ -8201,7 +8204,7 @@
8201
8204
  meta: {
8202
8205
  type: "suggestion",
8203
8206
  docs: {
8204
- url: "",
8207
+ url: "https://github.com/bigbinary/eslint-plugin-neeto/blob/main/docs/src/rules/use-common-constants.md",
8205
8208
  description: "Suggests using common constants from neeto-team-members and neeto-commons-frontend repos"
8206
8209
  }
8207
8210
  },
@@ -8215,7 +8218,7 @@
8215
8218
  checkAndReport({
8216
8219
  node: node,
8217
8220
  constants: neetoCommonsConstants__namespace,
8218
- repository: "neeto-commons-frontend",
8221
+ repository: "neeto-commons-frontend/constants",
8219
8222
  context: context
8220
8223
  });
8221
8224
  checkAndReport({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/eslint-plugin-neeto",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "main": "dist/index.js",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {