Betterer: Change message for localStorage usage (#105310)

* Change message

* Add message for packages
pull/106134/head
Tobias Skarhed 2 months ago committed by GitHub
parent b51d70aad9
commit f6b72a9c96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .betterer.eslint.config.js
  2. 189
      .betterer.results
  3. 3
      packages/grafana-data/src/utils/store.ts
  4. 3
      public/app/core/store.ts

@ -122,11 +122,11 @@ module.exports = [
'error', 'error',
{ {
selector: 'Identifier[name=localStorage]', selector: 'Identifier[name=localStorage]',
message: 'Direct usage of localStorage is not allowed. Use `Store` from @grafana/data instead.', message: 'Direct usage of localStorage is not allowed. import store from @grafana/data instead',
}, },
{ {
selector: 'MemberExpression[object.name=localStorage]', selector: 'MemberExpression[object.name=localStorage]',
message: 'Direct usage of localStorage is not allowed. Use `Store` from @grafana/data instead.', message: 'Direct usage of localStorage is not allowed. import store from @grafana/data instead',
}, },
{ {
selector: selector:

@ -12,15 +12,15 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"e2e/old-arch/utils/support/localStorage.ts:5381": [ "e2e/old-arch/utils/support/localStorage.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"e2e/old-arch/utils/support/types.ts:5381": [ "e2e/old-arch/utils/support/types.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"e2e/utils/support/localStorage.ts:5381": [ "e2e/utils/support/localStorage.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"e2e/utils/support/types.ts:5381": [ "e2e/utils/support/types.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
@ -369,12 +369,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"packages/grafana-data/src/utils/store.ts:5381": [ "packages/grafana-data/src/utils/store.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"]
], ],
"packages/grafana-data/src/utils/url.ts:5381": [ "packages/grafana-data/src/utils/url.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
@ -421,12 +421,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"packages/grafana-prometheus/src/components/metrics-browser/useMetricsLabelsValues.ts:5381": [ "packages/grafana-prometheus/src/components/metrics-browser/useMetricsLabelsValues.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"]
], ],
"packages/grafana-prometheus/src/datasource.ts:5381": [ "packages/grafana-prometheus/src/datasource.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
@ -479,7 +479,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"packages/grafana-runtime/src/config.ts:5381": [ "packages/grafana-runtime/src/config.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"], [0, 0, 0, "Do not use any type assertions.", "3"],
@ -530,18 +530,18 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"packages/grafana-runtime/src/utils/userStorage.tsx:5381": [ "packages/grafana-runtime/src/utils/userStorage.tsx:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "6"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "6"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "7"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "7"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "8"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "8"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "9"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "9"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "10"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "10"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "11"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "11"]
], ],
"packages/grafana-schema/src/veneer/common.types.ts:5381": [ "packages/grafana-schema/src/veneer/common.types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -844,7 +844,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"packages/grafana-ui/src/utils/logger.ts:5381": [ "packages/grafana-ui/src/utils/logger.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"]
], ],
"packages/grafana-ui/src/utils/useAsyncDependency.ts:5381": [ "packages/grafana-ui/src/utils/useAsyncDependency.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -963,9 +963,9 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/core/reducers/appNotification.ts:5381": [ "public/app/core/reducers/appNotification.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"]
], ],
"public/app/core/services/ResponseQueue.ts:5381": [ "public/app/core/services/ResponseQueue.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -991,6 +991,9 @@ exports[`better eslint`] = {
"public/app/core/specs/backend_srv.test.ts:5381": [ "public/app/core/specs/backend_srv.test.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/core/store.ts:5381": [
[0, 0, 0, "Do not re-export imported variable (\`store\`)", "0"]
],
"public/app/core/time_series2.ts:5381": [ "public/app/core/time_series2.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"],
@ -1323,14 +1326,14 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx:5381": [ "public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "6"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "6"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "7"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "7"]
], ],
"public/app/features/alerting/unified/components/rule-editor/alert-rule-form/simplifiedRouting/contactPoint/ContactPointSelector.tsx:5381": [ "public/app/features/alerting/unified/components/rule-editor/alert-rule-form/simplifiedRouting/contactPoint/ContactPointSelector.tsx:5381": [
[0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"] [0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"]
@ -1420,12 +1423,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/alerting/unified/rule-editor/formDefaults.ts:5381": [ "public/app/features/alerting/unified/rule-editor/formDefaults.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"]
], ],
"public/app/features/alerting/unified/rule-list/FilterViewStatus.tsx:5381": [ "public/app/features/alerting/unified/rule-list/FilterViewStatus.tsx:5381": [
[0, 0, 0, "Add noMargin prop to Card components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"] [0, 0, 0, "Add noMargin prop to Card components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"]
@ -1488,8 +1491,8 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts:5381": [ "public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"public/app/features/browse-dashboards/components/BrowseActions/MoveModal.tsx:5381": [ "public/app/features/browse-dashboards/components/BrowseActions/MoveModal.tsx:5381": [
[0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"] [0, 0, 0, "Add noMargin prop to Field components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"]
@ -2502,12 +2505,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"public/app/features/logs/utils.ts:5381": [ "public/app/features/logs/utils.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"],
[0, 0, 0, "Do not use any type assertions.", "6"] [0, 0, 0, "Do not use any type assertions.", "6"]
], ],
"public/app/features/manage-dashboards/DashboardImportPage.tsx:5381": [ "public/app/features/manage-dashboards/DashboardImportPage.tsx:5381": [
@ -2787,10 +2790,10 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "2"] [0, 0, 0, "Unexpected any. Specify a different type.", "2"]
], ],
"public/app/features/scopes/selector/ScopesSelectorService.ts:5381": [ "public/app/features/scopes/selector/ScopesSelectorService.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"]
], ],
"public/app/features/search/page/components/columns.tsx:5381": [ "public/app/features/search/page/components/columns.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
@ -2807,31 +2810,31 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"public/app/features/search/state/SearchStateManager.ts:5381": [ "public/app/features/search/state/SearchStateManager.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "6"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "6"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "7"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "7"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "8"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "8"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "9"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "9"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "10"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "10"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "11"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "11"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "12"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "12"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "13"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "13"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "14"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "14"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "15"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "15"],
[0, 0, 0, "Do not use any type assertions.", "16"] [0, 0, 0, "Do not use any type assertions.", "16"]
], ],
"public/app/features/search/types.ts:5381": [ "public/app/features/search/types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/search/utils.ts:5381": [ "public/app/features/search/utils.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"] [0, 0, 0, "Do not use any type assertions.", "3"]
], ],
"public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx:5381": [ "public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx:5381": [
@ -3741,21 +3744,21 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/plugins/datasource/loki/LogContextProvider.ts:5381": [ "public/app/plugins/datasource/loki/LogContextProvider.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"public/app/plugins/datasource/loki/components/LokiContextUi.tsx:5381": [ "public/app/plugins/datasource/loki/components/LokiContextUi.tsx:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "2"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "2"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "3"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "3"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "4"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "4"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "5"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "5"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "6"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "6"]
], ],
"public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx:5381": [ "public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx:5381": [ "public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -3782,12 +3785,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Add noMargin prop to Card components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"] [0, 0, 0, "Add noMargin prop to Card components to remove built-in margins. Use layout components like Stack or Grid with the gap prop instead for consistent spacing.", "0"]
], ],
"public/app/plugins/datasource/loki/querybuilder/state.ts:5381": [ "public/app/plugins/datasource/loki/querybuilder/state.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"public/app/plugins/datasource/loki/shardQuerySplitting.ts:5381": [ "public/app/plugins/datasource/loki/shardQuerySplitting.ts:5381": [
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "0"], [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "0"],
[0, 0, 0, "Direct usage of localStorage is not allowed. Use \`Store\` from @grafana/data instead.", "1"] [0, 0, 0, "Direct usage of localStorage is not allowed. import store from @grafana/data instead", "1"]
], ],
"public/app/plugins/datasource/loki/types.ts:5381": [ "public/app/plugins/datasource/loki/types.ts:5381": [
[0, 0, 0, "Do not re-export imported variable (\`LokiQueryDirection\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`LokiQueryDirection\`)", "0"],

@ -1,6 +1,9 @@
type StoreValue = string | number | boolean | null; type StoreValue = string | number | boolean | null;
type StoreSubscriber = () => void; type StoreSubscriber = () => void;
/**
* @deprecated Import singleton instance 'store' from '@grafana/data' instead
*/
export class Store { export class Store {
private subscribers: Map<string, Set<StoreSubscriber>> = new Map(); private subscribers: Map<string, Set<StoreSubscriber>> = new Map();

@ -1,4 +1,3 @@
import { Store } from '@grafana/data'; import { store } from '@grafana/data';
const store = new Store();
export default store; export default store;

Loading…
Cancel
Save