Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/build-chartcuterie.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
/* eslint-disable import/no-nodejs-modules, no-console */

import childProcess from 'node:child_process';
Expand Down
28 changes: 22 additions & 6 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* `npx eslint --inspect-config`
*/

import e18e from '@e18e/eslint-plugin';
/**
* Import Linting Strategy
*
Expand All @@ -25,6 +24,7 @@ import e18e from '@e18e/eslint-plugin';
* - Controls which internal modules can import from each other
* - Examples: preventing sentry from importing getsentry, core isolation, test boundaries
*/
import e18e from '@e18e/eslint-plugin';
import * as emotion from '@emotion/eslint-plugin';
import eslint from '@eslint/js';
// eslint-disable-next-line boundaries/dependencies
Expand Down Expand Up @@ -665,7 +665,7 @@ export default typescript.config([
files: [
'*.config.*',
'**/__mocks__/*',
'static/app/stories/*-loader.ts',
'static/app/stories/*Loader.ts',
'static/app/chartcuterie/config.tsx',
'tests/js/*-transform.*',
'tests/js/test-*/*',
Expand Down Expand Up @@ -832,14 +832,30 @@ export default typescript.config([
extends: [unicorn.configs.unopinionated],
rules: {
'unicorn/custom-error-definition': 'error',
Comment thread
sentry[bot] marked this conversation as resolved.
'unicorn/no-instanceof-array': 'error',
'unicorn/no-useless-undefined': ['error', {checkArguments: false}],

'unicorn/filename-case': ['off', {case: 'camelCase'}], // TODO(ryan953): Fix violations and enable this rule
'unicorn/filename-case': [
'error',
{
case: 'camelCase',
ignore: [
'jest-pegjs-transform\\.js',
'jest-environment\\.js',
'jest-environment-node\\.js',
'/__mocks__/',
// Shebang scripts can't use an inline disable comment (it must sit
// on line 1, where the shebang is) and are invoked by their
// kebab-case names from package.json/CI, so ignore them here.
'analyze-styled\\.ts$',
'type-coverage\\.ts$',
'type-coverage-diff\\.ts$',
],
},
],
Comment thread
cursor[bot] marked this conversation as resolved.
'unicorn/no-array-push-push': 'error',
'unicorn/no-instanceof-array': 'error',
'unicorn/no-single-promise-in-promise-methods': 'warn', // TODO(ryan953): Fix violations and enable this rule
'unicorn/no-static-only-class': 'off', // TODO(ryan953): Fix violations and enable this rule
'unicorn/no-this-assignment': 'off', // TODO(ryan953): Fix violations and enable this rule
'unicorn/no-useless-undefined': ['error', {checkArguments: false}],
'unicorn/no-zero-fractions': 'error',
'unicorn/prefer-array-flat': 'off', // TODO(ryan953): Fix violations and enable this rule
'unicorn/prefer-default-parameters': 'warn', // TODO(ryan953): Fix violations and enable this rule
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const config: Config.InitialOptions = {
},
passWithNoTests: JEST_TESTS !== undefined,
setupFiles: [
'<rootDir>/static/app/utils/silence-react-unsafe-warnings.ts',
'<rootDir>/static/app/utils/silenceReactUnsafeWarnings.ts',
'jest-canvas-mock',
],
setupFilesAfterEnv: [
Expand Down
2 changes: 1 addition & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const productionEntryPoints = [
// the main entry points - app, gsAdmin & gsApp
'static/app/index.tsx',
// defined in rspack.config.ts pipelines
'static/app/utils/statics-setup.tsx',
'static/app/utils/setupStatics.tsx',
'static/app/serviceWorker/worker/worker.ts',
// exports used by scripts
'static/app/components/seer/markdown/embeds/schemas.ts',
Expand Down
6 changes: 3 additions & 3 deletions rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ const appConfig: Configuration = {
*
* The order here matters for `getsentry`
*/
app: ['sentry/utils/statics-setup', 'sentry'],
app: ['sentry/utils/setupStatics', 'sentry'],

// admin interface
gsAdmin: ['sentry/utils/statics-setup', path.join(staticPrefix, 'gsAdmin')],
gsAdmin: ['sentry/utils/setupStatics', path.join(staticPrefix, 'gsAdmin')],

/**
* Legacy CSS Webpack appConfig for Django-powered views.
Expand Down Expand Up @@ -476,7 +476,7 @@ const appConfig: Configuration = {
alias: {
'type-loader': path.resolve(
import.meta.dirname,
'static/app/stories/type-loader.ts'
'static/app/stories/typeLoader.ts'
),
},
},
Expand Down
1 change: 1 addition & 0 deletions scripts/build-js-loader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
'use strict';

import fs from 'node:fs';
Expand Down
1 change: 1 addition & 0 deletions scripts/dev-ui-server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {spawn} from 'node:child_process';
import * as net from 'node:net';

Expand Down
1 change: 1 addition & 0 deletions static/app/__mocks__/react-date-range.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {CalendarProps, DateRangeProps, Range, RangeKeyDict} from 'react-date-range';
import moment from 'moment-timezone';

Expand Down
1 change: 1 addition & 0 deletions static/app/__mocks__/react-lazyload.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
/**
* Auto-mock of the react-lazyload library for jest
*
Expand Down
2 changes: 1 addition & 1 deletion static/app/bootstrap/commonInitialization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (IS_ACCEPTANCE_TEST || NODE_ENV === 'test') {

export function commonInitialization(config: Config) {
if (NODE_ENV === 'development') {
import(/* webpackMode: "eager" */ 'sentry/utils/silence-react-unsafe-warnings');
import(/* webpackMode: "eager" */ 'sentry/utils/silenceReactUnsafeWarnings');
}

ConfigStore.loadInitialData(config);
Expand Down
1 change: 1 addition & 0 deletions static/app/components/IssueStreamHeaderLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {css} from '@emotion/react';
import styled from '@emotion/styled';

Expand Down
1 change: 1 addition & 0 deletions static/app/components/core/form/FormSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {ReactNode} from 'react';

interface FormSearchProps {
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/deviceName.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useMemo} from 'react';

import {iOSDeviceMapping} from 'sentry/constants/ios-device-list';
import {iOSDeviceMapping} from 'sentry/constants/iosDeviceList';

export function deviceNameMapper(model: string | undefined): string | null {
// If we have no model, render nothing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {Fragment, useEffect} from 'react';
import styled from '@emotion/styled';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {useCallback, useEffect, useRef} from 'react';
import styled from '@emotion/styled';
import RRWebPlayer from '@sentry-internal/rrweb-player';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import styled from '@emotion/styled';

import replaysInlineOnboarding from 'sentry-images/spot/replay-onboarding-backend.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {useMemo} from 'react';
import type * as Sentry from '@sentry/react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {Button, type ButtonProps} from '@sentry/scraps/button';

import {openPrivateGamingSdkAccessModal} from 'sentry/actionCreators/modal';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {css, keyframes} from '@emotion/react';
import styled from '@emotion/styled';
import type {Transition} from 'framer-motion';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';

import {FlamegraphWarnings} from 'sentry/components/profiling/flamegraph/flamegraphOverlays/FlamegraphWarnings';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import styled from '@emotion/styled';

import {Button} from '@sentry/scraps/button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {CSSProperties} from 'react';
import {Fragment, useCallback, useEffect, useMemo, useState} from 'react';
import styled from '@emotion/styled';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {Fragment, useMemo} from 'react';
import type {vec2} from 'gl-matrix';

Expand Down
1 change: 1 addition & 0 deletions static/app/components/quietZoneQRCode.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type React from 'react';
import styled from '@emotion/styled';
import {QRCodeCanvas} from 'qrcode.react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {EmptyStateWarning} from 'sentry/components/emptyStateWarning';
import {t} from 'sentry/locale';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {IconWarning} from 'sentry/icons';

import {GridBodyCellStatus, GridRow} from './styles';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {LoadingIndicator} from 'sentry/components/loadingIndicator';

import {GridBodyCellStatus, GridRow} from './styles';
Expand Down
4 changes: 2 additions & 2 deletions static/app/serviceWorker/worker/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {controlsiloUrlPatterns} from 'sentry/data/controlsiloUrlPatterns';
import {getClientConfigFromCache} from 'sentry/serviceWorker/worker/client-config';
import {type ClientConfig} from 'sentry/serviceWorker/worker/client-config';
import {getClientConfigFromCache} from 'sentry/serviceWorker/worker/clientConfig';
import {type ClientConfig} from 'sentry/serviceWorker/worker/clientConfig';
import {getApiUrl} from 'sentry/utils/api/getApiUrl';

type ApiUrl = ReturnType<typeof getApiUrl>;
Expand Down
2 changes: 1 addition & 1 deletion static/app/serviceWorker/worker/initializeSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SPA_MODE_ALLOW_URLS,
SPA_MODE_TRACE_PROPAGATION_TARGETS,
} from 'sentry/constants/sdk';
import type {ClientConfig} from 'sentry/serviceWorker/worker/client-config';
import type {ClientConfig} from 'sentry/serviceWorker/worker/clientConfig';

let isInitialized = false;

Expand Down
2 changes: 1 addition & 1 deletion static/app/serviceWorker/worker/worker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

import type {ResponseMessage} from 'sentry/serviceWorker/types';
import {fetchClientConfig} from 'sentry/serviceWorker/worker/client-config';
import {fetchClientConfig} from 'sentry/serviceWorker/worker/clientConfig';
import {DEBUG_LOGGING, log} from 'sentry/serviceWorker/worker/constants';
import {handleInboundEvent} from 'sentry/serviceWorker/worker/handleInboundEvent';
import {handleInboundRequest} from 'sentry/serviceWorker/worker/handleInboundRequest';
Expand Down
1 change: 1 addition & 0 deletions static/app/stores/IssueListCacheStore.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import isEqual from 'lodash/isEqual';
import {createStore} from 'reflux';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {VirtualizedTree} from 'sentry/utils/profiling/hooks/useVirtualizedTree/VirtualizedTree';
import type {VirtualizedTreeNode} from 'sentry/utils/profiling/hooks/useVirtualizedTree/VirtualizedTreeNode';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {TreeLike} from 'sentry/utils/profiling/hooks/useVirtualizedTree/useVirtualizedTree';

import {VirtualizedTreeNode} from './VirtualizedTreeNode';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {VirtualizedTreeNode} from 'sentry/utils/profiling/hooks/useVirtualizedTree/VirtualizedTreeNode';

describe('VirtualizedTreeNode', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
export class VirtualizedTreeNode<T> {
node: T;
parent: VirtualizedTreeNode<T> | null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {mat3, vec2} from 'gl-matrix';

import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {mat3} from 'gl-matrix';

import {colorComponentsToRGBA} from 'sentry/utils/profiling/colors/utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {vec2} from 'gl-matrix';
import {ThemeFixture} from 'sentry-fixture/theme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import * as Sentry from '@sentry/react';
import type {vec2} from 'gl-matrix';
import {mat3} from 'gl-matrix';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {vec2} from 'gl-matrix';
import {ThemeFixture} from 'sentry-fixture/theme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import * as Sentry from '@sentry/react';
import {mat3} from 'gl-matrix';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {ReplayRecordFixture} from 'sentry-fixture/replayRecord';

import {recordingEndFrame} from 'sentry/utils/replays/hydrateRRWebRecordingFrames';
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/replays/hydrateRRWebRecordingFrames.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {RecordingFrame} from 'sentry/utils/replays/types';
import {EventType} from 'sentry/utils/replays/types';
import type {HydratedReplayRecord} from 'sentry/views/explore/replays/types';
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/containsCRLF.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
const CRLF_REGEXP = /[\r\n]/;

export function containsCRLF(value: string) {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/isUUID.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {isUUID} from 'sentry/utils/string/isUUID';

describe('isUUID', () => {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/isUUID.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
export function isUUID(uuid: string): boolean {
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
return uuidRegex.test(uuid);
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/looksLikeAJSONArray.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {looksLikeAJSONArray} from './looksLikeAJSONArray';

describe('looksLikeAJSONArray', () => {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/looksLikeAJSONArray.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
/**
* Check if a string value looks like it could be a JSON-encoded array. This is
useful for situations where we used JSON strings to store array values because
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/looksLikeAJSONObject.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {looksLikeAJSONObject} from './looksLikeAJSONObject';

describe('looksLikeAJSONObject', () => {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/string/looksLikeAJSONObject.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
/**
* Check if a string value looks like it could be a JSON-encoded object. This is
useful for situations where we used JSON strings to store object values because
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/url/safeURL.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {safeURL} from './safeURL';

describe('safeURL', () => {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/url/safeURL.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
/**
* Does not throw error on invalid input and returns the parsed URL object
* if the input is a valid URL, otherwise returns undefined.
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/url/stripURLOrigin.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {stripURLOrigin} from 'sentry/utils/url/stripURLOrigin';

describe('stripURLOrigin', () => {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/url/stripURLOrigin.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {safeURL} from 'sentry/utils/url/safeURL';

/**
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/useRAF.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {useEffect} from 'react';

export function useRAF(callback: () => unknown, opts?: {enabled: boolean}) {
Expand Down
1 change: 1 addition & 0 deletions static/app/views/alerts/rules/APIUsageWarningBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {Alert} from '@sentry/scraps/alert';
import {ExternalLink} from '@sentry/scraps/link';

Expand Down
1 change: 1 addition & 0 deletions static/app/views/app/asyncSDKIntegrationProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {createContext, useContext, useState} from 'react';
import type {addIntegration} from '@sentry/react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import type {ReactNode} from 'react';
import {createContext, useContext, useState} from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {WidgetFixture} from 'sentry-fixture/widget';

import {DisplayType} from 'sentry/views/dashboards/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
import {OP_LABELS} from 'sentry/components/searchQueryBuilder/tokens/filter/utils';
import type {Widget} from 'sentry/views/dashboards/types';
import {DisplayType} from 'sentry/views/dashboards/types';
Expand Down
Loading
Loading