@bigbinary/eslint-plugin-neeto 1.5.2 → 1.5.4

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
@@ -115,6 +115,7 @@ of the issues identified in JavaScript code.
115
115
  - [use-show-thumbs-up-toastr](./docs/src/rules/use-show-thumbs-up-toastr)
116
116
  - [ensure-usestate-has-initial-value](./docs/src/rules/ensure-usestate-has-initial-value.md)
117
117
  - [ensure-peer-dependencies-are-in-sync](./docs/src/rules/ensure-peer-dependencies-are-in-sync.md)
118
+ - [use-dayjs-from-neeto-commons-fronted](./docs/src/rules/use-dayjs-from-neeto-commons-fronted.md)
118
119
 
119
120
  ### Warnings
120
121
 
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@
42
42
  var commonResolve$2 = loadJS$2("node_modules/@bigbinary/neeto-commons-frontend/configs/webpack/resolve.js");
43
43
  var resolve$2 = ramda.mergeDeepLeft(projectResolve$2, commonResolve$2);
44
44
  var rules = {
45
+ "@bigbinary/neeto/use-dayjs-from-neeto-commons-fronted": "error",
45
46
  "@bigbinary/neeto/use-neetoui-action-block-in-formik-forms": "warn",
46
47
  "@bigbinary/neeto/no-unnecessary-classnames": "error",
47
48
  "@bigbinary/neeto/no-snake-case-destructuring-for-use-query-params-and-get-query-params": "warn",
@@ -498,6 +499,9 @@
498
499
  var replaceZustandDefaultExportWith = function replaceZustandDefaultExportWith(fix) {
499
500
  return "Zustand has deprecated the use of default exports for its functions. Replace this with: ".concat(fix);
500
501
  };
502
+ var replaceDayjsDefaultExportWith = function replaceDayjsDefaultExportWith(fix) {
503
+ return "Replace with: ".concat(fix);
504
+ };
501
505
  var replaceTailwindClass = function replaceTailwindClass(tailwindClass, neetoUIClass) {
502
506
  return "Replace the class \"".concat(tailwindClass, "\" with its neetoui alternative \"").concat(neetoUIClass, "\"");
503
507
  };
@@ -10938,6 +10942,39 @@
10938
10942
  }
10939
10943
  };
10940
10944
 
10945
+ var DAYJS_IMPORT_PATTERN = {
10946
+ type: TYPES.IMPORT_DECLARATION,
10947
+ source: {
10948
+ value: "dayjs"
10949
+ }
10950
+ };
10951
+
10952
+ var useDayjsFromNeetoCommonsFronted = {
10953
+ meta: {
10954
+ type: "error",
10955
+ docs: {
10956
+ url: "https://github.com/bigbinary/eslint-plugin-neeto/blob/main/docs/src/rules/use-dayjs-from-neeto-commons-fronted.md",
10957
+ description: "Enforce using dayjs from neetocommons/utils."
10958
+ },
10959
+ fixable: "code"
10960
+ },
10961
+ create: function create(context) {
10962
+ return {
10963
+ ImportDeclaration: function ImportDeclaration(node) {
10964
+ if (!neetoCist.matches(DAYJS_IMPORT_PATTERN, node)) return;
10965
+ var _fix = "import { dayjs } from \"neetocommons/utils\";";
10966
+ context.report({
10967
+ node: node,
10968
+ message: replaceDayjsDefaultExportWith(_fix),
10969
+ fix: function fix(fixer) {
10970
+ return fixer.replaceText(node, _fix);
10971
+ }
10972
+ });
10973
+ }
10974
+ };
10975
+ }
10976
+ };
10977
+
10941
10978
  var RETURN_STATEMENT_PATTERN = {
10942
10979
  type: TYPES.RETURN_STATEMENT
10943
10980
  };
@@ -12505,6 +12542,7 @@
12505
12542
 
12506
12543
  var index = {
12507
12544
  rules: {
12545
+ "use-dayjs-from-neeto-commons-fronted": useDayjsFromNeetoCommonsFronted,
12508
12546
  "use-neetoui-action-block-in-formik-forms": useNeetouiActionBlockInFormikForms,
12509
12547
  "no-unnecessary-classnames": noUnnecessaryClassnames,
12510
12548
  "no-snake-case-destructuring-for-use-query-params-and-get-query-params": noSnakeCaseDestructuringForUseQueryParamsAndGetQueryParams,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/eslint-plugin-neeto",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "main": "dist/index.js",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {