@bigbinary/eslint-plugin-neeto 1.1.29 → 1.1.30
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 +25 -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
|
+
- [no-local-storage](./docs/src/rules/no-local-storage.md)
|
|
49
50
|
- [use-use-query-client-hook](./docs/src/rules/use-use-query-client-hook.md)
|
|
50
51
|
- [use-early-return](./docs/src/rules/use-early-return.md)
|
|
51
52
|
- [use-classnames-for-dynamic-classes](./docs/src/rules/use-classnames-for-dynamic-classes.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/no-local-storage": "error",
|
|
45
46
|
"@bigbinary/neeto/use-use-query-client-hook": "error",
|
|
46
47
|
"@bigbinary/neeto/use-early-return": "warn",
|
|
47
48
|
"@bigbinary/neeto/use-classnames-for-dynamic-classes": "error",
|
|
@@ -556,6 +557,7 @@
|
|
|
556
557
|
var USE_CLASSNAMES_PACKAGE = "Use classnames package for dynamic classes";
|
|
557
558
|
var USE_USE_QUERY_CLIENT_HOOK = "Use 'useQueryClient' hook from 'react-query'";
|
|
558
559
|
var USE_EARLY_RETURN = "Use early return to avoid nested statement";
|
|
560
|
+
var NO_LOCAL_STORAGE = "Do not use localStorage directly. Use 'getFromLocalStorage()', 'setToLocalStorage()', or 'useLocalStorage()' from neeto-commons-frontend instead.";
|
|
559
561
|
|
|
560
562
|
var PACKAGES_TO_CHECK = ["@bigbinary/neeto-molecules", "@bigbinary/neetoui", "@bigbinary/neeto-commons-frontend"];
|
|
561
563
|
|
|
@@ -6192,6 +6194,28 @@
|
|
|
6192
6194
|
}
|
|
6193
6195
|
};
|
|
6194
6196
|
|
|
6197
|
+
var noLocalStorage = {
|
|
6198
|
+
meta: {
|
|
6199
|
+
type: "error",
|
|
6200
|
+
docs: {
|
|
6201
|
+
url: "https://github.com/bigbinary/eslint-plugin-neeto/blob/main/docs/src/rules/no-local-storage.md",
|
|
6202
|
+
description: "Disallows the usage of localStorage directly"
|
|
6203
|
+
}
|
|
6204
|
+
},
|
|
6205
|
+
create: function create(context) {
|
|
6206
|
+
return {
|
|
6207
|
+
MemberExpression: function MemberExpression(node) {
|
|
6208
|
+
if (node.object.name === "localStorage") {
|
|
6209
|
+
context.report({
|
|
6210
|
+
node: node,
|
|
6211
|
+
message: NO_LOCAL_STORAGE
|
|
6212
|
+
});
|
|
6213
|
+
}
|
|
6214
|
+
}
|
|
6215
|
+
};
|
|
6216
|
+
}
|
|
6217
|
+
};
|
|
6218
|
+
|
|
6195
6219
|
var noMultipleComponentsInAFile = {
|
|
6196
6220
|
meta: {
|
|
6197
6221
|
type: "problem",
|
|
@@ -10193,6 +10217,7 @@
|
|
|
10193
10217
|
|
|
10194
10218
|
var index = {
|
|
10195
10219
|
rules: {
|
|
10220
|
+
"no-local-storage": noLocalStorage,
|
|
10196
10221
|
"use-use-query-client-hook": useUseQueryClientHook,
|
|
10197
10222
|
"use-early-return": useEarlyReturn,
|
|
10198
10223
|
"use-classnames-for-dynamic-classes": useClassnamesForDynamicClasses,
|