@bigbinary/eslint-plugin-neeto 1.1.14 → 1.1.15
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 +1 -0
- package/dist/index.js +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ module.exports = {
|
|
|
46
46
|
|
|
47
47
|
## Exported rules
|
|
48
48
|
|
|
49
|
+
- [use-standard-date-time-formats](./docs/src/rules/use-standard-date-time-formats.md)
|
|
49
50
|
- [no-dumb-components-with-use-translation](./docs/src/rules/no-dumb-components-with-use-translation.md)
|
|
50
51
|
- [no-unnecessary-if-condition](./docs/src/rules/no-unnecessary-if-condition.md)
|
|
51
52
|
- [api-connector-name-should-match-filename](./docs/src/rules/api-connector-name-should-match-filename.md)
|
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-standard-date-time-formats": "error",
|
|
45
46
|
"@bigbinary/neeto/no-dumb-components-with-use-translation": "error",
|
|
46
47
|
"@bigbinary/neeto/api-connector-name-should-match-filename": "error",
|
|
47
48
|
"@bigbinary/neeto/api-connector-should-use-default-export": "error",
|
|
@@ -526,6 +527,7 @@
|
|
|
526
527
|
var PROP_KEY_VALUE_DUPLICATE = "Prop key and value names should not be repeated";
|
|
527
528
|
var USE_WITH_IMMUTABLE_ACTIONS_WRAPPER = 'Use "withImmutableActions" wrapper from "neeto-commons-frontend" inside zustand create. Refer: https://bit.ly/withimmutableactions';
|
|
528
529
|
var USE_WITH_T_HOC_IN_DUMB_COMPONENTS = 'Use "withT" HOC from "neeto-commons-frontend" instead of useTranslation hook in Dumb components';
|
|
530
|
+
var USE_STANDARD_DATE_TIME_FORMATS = 'Use "dateFormat/timeFormat" from "@bigbinary/neeto-commons-frontend/utils" instead. Refer: https://github.com/bigbinary/neeto-commons-frontend/blob/main/docs/utils/README.md#dateformattimeformat';
|
|
529
531
|
|
|
530
532
|
var PACKAGES_TO_CHECK = ["@bigbinary/neeto-molecules", "@bigbinary/neetoui", "@bigbinary/neeto-commons-frontend"];
|
|
531
533
|
|
|
@@ -25956,6 +25958,33 @@
|
|
|
25956
25958
|
}
|
|
25957
25959
|
};
|
|
25958
25960
|
|
|
25961
|
+
var useStandardDateTimeFormats = {
|
|
25962
|
+
meta: {
|
|
25963
|
+
type: "problem",
|
|
25964
|
+
docs: {
|
|
25965
|
+
url: "https://github.com/bigbinary/eslint-plugin-neeto/blob/main/docs/src/rules/use-standard-date-time-formats.md",
|
|
25966
|
+
description: "Enforces the usage of standard date and time formats instead of dayjs().format()"
|
|
25967
|
+
}
|
|
25968
|
+
},
|
|
25969
|
+
create: function create(context) {
|
|
25970
|
+
var sourceCode = context.getSourceCode();
|
|
25971
|
+
return {
|
|
25972
|
+
CallExpression: function CallExpression(node) {
|
|
25973
|
+
var callee = node.callee;
|
|
25974
|
+
if (callee.type !== TYPES.MEMBER_EXPRESSION) return;
|
|
25975
|
+
var expression = sourceCode.getText(callee);
|
|
25976
|
+
if (!(expression.includes("dayjs") && expression.includes(".format"))) {
|
|
25977
|
+
return;
|
|
25978
|
+
}
|
|
25979
|
+
context.report({
|
|
25980
|
+
node: node,
|
|
25981
|
+
message: USE_STANDARD_DATE_TIME_FORMATS
|
|
25982
|
+
});
|
|
25983
|
+
}
|
|
25984
|
+
};
|
|
25985
|
+
}
|
|
25986
|
+
};
|
|
25987
|
+
|
|
25959
25988
|
var useWebpackAlias = {
|
|
25960
25989
|
meta: {
|
|
25961
25990
|
type: "suggestion",
|
|
@@ -26539,6 +26568,7 @@
|
|
|
26539
26568
|
|
|
26540
26569
|
var index = {
|
|
26541
26570
|
rules: {
|
|
26571
|
+
"use-standard-date-time-formats": useStandardDateTimeFormats,
|
|
26542
26572
|
"no-dumb-components-with-use-translation": noDumbComponentsWithUseTranslation,
|
|
26543
26573
|
"api-connector-name-should-match-filename": apiConnectorNameShouldMatchFilename,
|
|
26544
26574
|
"api-connector-should-use-default-export": apiConnectorShouldUseDefaultExport,
|