Add no localstorage rule
This commit is contained in:
18
.eslintrc.js
18
.eslintrc.js
@@ -42,6 +42,24 @@ module.exports = {
|
|||||||
"prettier/prettier": ["warn", { semi: false }],
|
"prettier/prettier": ["warn", { semi: false }],
|
||||||
"import/no-named-as-default": "off",
|
"import/no-named-as-default": "off",
|
||||||
"no-undef": "off",
|
"no-undef": "off",
|
||||||
|
// localStorage block
|
||||||
|
"no-restricted-globals": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
name: "localStorage",
|
||||||
|
message:
|
||||||
|
"Do not use 'localStorage' directly. Please use localpersistence.ts functions or stores",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// window.localStorage block
|
||||||
|
"no-restricted-syntax": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
selector: "CallExpression[callee.object.property.name='localStorage']",
|
||||||
|
message:
|
||||||
|
"Do not use 'localStorage' directly. Please use localpersistence.ts functions or stores",
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
$nuxt: true,
|
$nuxt: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user