diff --git a/.betterer.eslint.config.js b/.betterer.eslint.config.js index 5735cbaec0d..80231c4a1e9 100644 --- a/.betterer.eslint.config.js +++ b/.betterer.eslint.config.js @@ -122,11 +122,11 @@ module.exports = [ 'error', { 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]', - 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: diff --git a/.betterer.results b/.betterer.results index 2203206eda7..ee6ca47ec3d 100644 --- a/.betterer.results +++ b/.betterer.results @@ -12,15 +12,15 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "e2e/old-arch/utils/support/types.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "e2e/utils/support/types.ts:5381": [ [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"] ], "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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "5"] + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"] ], "packages/grafana-data/src/utils/url.ts:5381": [ [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"] ], "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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "5"] + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"] ], "packages/grafana-prometheus/src/datasource.ts:5381": [ [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"] ], "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.", "2"], [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"] ], "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. Use \`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. Use \`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. Use \`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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "11"] + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"], + [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. import store from @grafana/data instead", "7"], + [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. import store from @grafana/data instead", "9"], + [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. import store from @grafana/data instead", "11"] ], "packages/grafana-schema/src/veneer/common.types.ts:5381": [ [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"] ], "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": [ [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"] ], "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. Use \`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", "0"], + [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. import store from @grafana/data instead", "2"] ], "public/app/core/services/ResponseQueue.ts:5381": [ [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": [ [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": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [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"] ], "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. Use \`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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "7"] + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"], + [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. import store from @grafana/data instead", "7"] ], "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"] @@ -1420,12 +1423,12 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "5"] + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"] ], "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"] @@ -1488,8 +1491,8 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "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"] @@ -2502,12 +2505,12 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"] ], "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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "5"], + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"], [0, 0, 0, "Do not use any type assertions.", "6"] ], "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"] ], "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. Use \`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. Use \`Store\` from @grafana/data instead.", "3"] + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"] ], "public/app/features/search/page/components/columns.tsx:5381": [ [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"] ], "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. Use \`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. Use \`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. Use \`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. Use \`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. Use \`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. Use \`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. Use \`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. Use \`Store\` from @grafana/data instead.", "15"], + [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. import store from @grafana/data instead", "1"], + [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. import store from @grafana/data instead", "3"], + [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. import store from @grafana/data instead", "5"], + [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. import store from @grafana/data instead", "7"], + [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. import store from @grafana/data instead", "9"], + [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. import store from @grafana/data instead", "11"], + [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. import store from @grafana/data instead", "13"], + [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. import store from @grafana/data instead", "15"], [0, 0, 0, "Do not use any type assertions.", "16"] ], "public/app/features/search/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "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. Use \`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", "0"], + [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. import store from @grafana/data instead", "2"], [0, 0, 0, "Do not use any type assertions.", "3"] ], "public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx:5381": [ @@ -3741,21 +3744,21 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "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. Use \`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. Use \`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. Use \`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", "0"], + [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. import store from @grafana/data instead", "2"], + [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. import store from @grafana/data instead", "4"], + [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. import store from @grafana/data instead", "6"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx:5381": [ [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"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "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. Use \`Store\` from @grafana/data instead.", "1"] + [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. import store from @grafana/data instead", "1"] ], "public/app/plugins/datasource/loki/types.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`LokiQueryDirection\`)", "0"], diff --git a/packages/grafana-data/src/utils/store.ts b/packages/grafana-data/src/utils/store.ts index 8d5a5b1e933..49dd4d26340 100644 --- a/packages/grafana-data/src/utils/store.ts +++ b/packages/grafana-data/src/utils/store.ts @@ -1,6 +1,9 @@ type StoreValue = string | number | boolean | null; type StoreSubscriber = () => void; +/** + * @deprecated Import singleton instance 'store' from '@grafana/data' instead + */ export class Store { private subscribers: Map> = new Map(); diff --git a/public/app/core/store.ts b/public/app/core/store.ts index 5d64753e7e5..08df9e8ab7b 100644 --- a/public/app/core/store.ts +++ b/public/app/core/store.ts @@ -1,4 +1,3 @@ -import { Store } from '@grafana/data'; +import { store } from '@grafana/data'; -const store = new Store(); export default store;