@bigbinary/eslint-plugin-neeto 1.1.8 → 1.1.9

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 +14 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -82,7 +82,8 @@
82
82
  "@bigbinary/neeto/no-globalProps-reassignment": "error",
83
83
  "@bigbinary/neeto/no-missing-localization": ["error", {
84
84
  translationsDir: absolutePath("app/javascript/src/translations"),
85
- languages: ["en"]
85
+ languages: ["en"],
86
+ nanosTranslationDir: [absolutePath("node_modules/@bigbinary/neeto-team-members-frontend/src/translations")]
86
87
  }],
87
88
  "@bigbinary/neeto/no-multiple-components-in-a-file": "error",
88
89
  "@bigbinary/neeto/no-multiple-translation-functions-under-same-parent": "error",
@@ -4117,6 +4118,7 @@
4117
4118
  function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4118
4119
  function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4119
4120
  var translationFiles = [];
4121
+ var nanosContent = {};
4120
4122
  var previousOptions = null;
4121
4123
  var watcher$1 = null;
4122
4124
  var watchTranslationsDir = function watchTranslationsDir(translationsDirPath) {
@@ -4126,7 +4128,7 @@
4126
4128
  var lng = changedFileName.split(".")[0];
4127
4129
  translationFiles = pure.modifyBy({
4128
4130
  lng: lng
4129
- }, ramda.assoc("content", parseJsonData(path$2.join(translationsDirPath, changedFileName))), translationFiles);
4131
+ }, ramda.assoc("content", _objectSpread$3(_objectSpread$3({}, parseJsonData(path$2.join(translationsDirPath, changedFileName))), nanosContent[lng])), translationFiles);
4130
4132
  });
4131
4133
  };
4132
4134
  var checkAndReport$2 = function checkAndReport(_ref) {
@@ -4181,10 +4183,19 @@
4181
4183
  },
4182
4184
  create: function create(context) {
4183
4185
  if (pure.isNot(previousOptions, context.options[0])) {
4186
+ var nanosTranslationOption = context.options[0].nanosTranslationDir;
4184
4187
  translationFiles = context.options[0].languages.map(function (lng) {
4188
+ nanosContent[lng] = nanosTranslationOption ? nanosTranslationOption.map(function (filePath) {
4189
+ return path$2.join(filePath, "".concat(lng, ".json"));
4190
+ }).reduce(function (mergedObj, filePath) {
4191
+ return _objectSpread$3(_objectSpread$3({}, mergedObj), parseJsonData(filePath));
4192
+ }, {}) : {};
4193
+ var translationsFilePath = path$2.join(context.options[0].translationsDir, "".concat(lng, ".json"));
4194
+ var translationsContent = parseJsonData(translationsFilePath);
4195
+ var combinedContent = _objectSpread$3(_objectSpread$3({}, translationsContent), nanosContent[lng]);
4185
4196
  return {
4186
4197
  lng: lng,
4187
- content: parseJsonData(path$2.join(context.options[0].translationsDir, "".concat(lng, ".json")))
4198
+ content: combinedContent
4188
4199
  };
4189
4200
  });
4190
4201
  previousOptions = context.options[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/eslint-plugin-neeto",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "main": "dist/index.js",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {