SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
chore: remove airbnb from ESLint, update prettier rules and update VS Code settings (#10013)
Ashwin Bhatkal4f9efcc133bb
diff --git a/.gitignore b/.gitignoreindex 3d249a46bd..99260305e2 100644--- a/.gitignore+++ b/.gitignore@@ -12,7 +12,6 @@ frontend/coverage# productionfrontend/build-frontend/.vscodefrontend/.yarncleanfrontend/.temp_cachefrontend/test-results@@ -31,7 +30,6 @@ frontend/src/constants/env.ts.idea-**/.vscode**/build**/storage**/locust-scripts/__pycache__/diff --git a/.vscode/settings.json b/.vscode/settings.jsonnew file mode 100644index 0000000000..860a91c9c6--- /dev/null+++ b/.vscode/settings.json@@ -0,0 +1,9 @@+{+ "eslint.workingDirectories": ["./frontend"],+ "editor.formatOnSave": true,+ "editor.defaultFormatter": "esbenp.prettier-vscode",+ "editor.codeActionsOnSave": {+ "source.fixAll.eslint": "explicit"+ },+ "prettier.requireConfig": true+}diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.jsindex c7de98b3a4..87d004ff50 100644--- a/frontend/.eslintrc.js+++ b/frontend/.eslintrc.js@@ -7,8 +7,6 @@ module.exports = {'jest/globals': true,},extends: [- 'airbnb',- 'airbnb-typescript','eslint:recommended','plugin:react/recommended','plugin:@typescript-eslint/recommended',@@ -35,6 +33,7 @@ module.exports = {'react-hooks','prettier','jest',+ 'jsx-a11y',],settings: {react: {@@ -72,9 +71,6 @@ module.exports = {'react-hooks/rules-of-hooks': 'error','react-hooks/exhaustive-deps': 'error',- // airbnb- 'no-underscore-dangle': 'off',- 'no-console': 'off','import/prefer-default-export': 'off','import/extensions': ['error',@@ -87,6 +83,9 @@ module.exports = {},],'import/no-extraneous-dependencies': ['error', { devDependencies: true }],+ // Disabled because TypeScript already handles this check more accurately,+ // and the rule has false positives with type-only imports (e.g., TooltipProps from antd)+ 'import/named': 'off','no-plusplus': 'off','jsx-a11y/label-has-associated-control': ['error',@@ -104,7 +103,10 @@ module.exports = {},},],- '@typescript-eslint/no-unused-vars': 'error',+ // Allow empty functions for mocks, default context values, and noop callbacks+ '@typescript-eslint/no-empty-function': 'off',+ // Allow underscore prefix for intentionally unused variables (e.g., const { id: _id, ...rest } = props)+ '@typescript-eslint/no-unused-vars': 'warn','func-style': ['error', 'declaration', { allowArrowFunctions: true }],'arrow-body-style': ['error', 'as-needed'],diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.jsonindex a147736ad6..e350d92369 100644--- a/frontend/.prettierrc.json+++ b/frontend/.prettierrc.json@@ -4,5 +4,14 @@"tabWidth": 1,"singleQuote": true,"jsxSingleQuote": false,- "semi": true+ "semi": true,+ "printWidth": 80,+ "bracketSpacing": true,+ "bracketSameLine": false,+ "arrowParens": "always",+ "endOfLine": "lf",+ "quoteProps": "as-needed",+ "proseWrap": "preserve",+ "htmlWhitespaceSensitivity": "css",+ "embeddedLanguageFormatting": "auto"}diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.jsonnew file mode 100644index 0000000000..920abde590--- /dev/null+++ b/frontend/.vscode/settings.json@@ -0,0 +1,8 @@+{+ "editor.formatOnSave": true,+ "editor.defaultFormatter": "esbenp.prettier-vscode",+ "editor.codeActionsOnSave": {+ "source.fixAll.eslint": "explicit"+ },+ "prettier.requireConfig": true+}diff --git a/frontend/CONTRIBUTIONS.md b/frontend/CONTRIBUTIONS.mdindex 0b3d76219c..f5574c8d9b 100644--- a/frontend/CONTRIBUTIONS.md+++ b/frontend/CONTRIBUTIONS.md@@ -34,12 +34,18 @@ Embrace the spirit of collaboration and contribute to the success of our open-so### Linting and Setup- It is crucial to refrain from disabling ESLint and TypeScript errors within the project. If there is a specific rule that needs to be disabled, provide a clear and justified explanation for doing so. Maintaining the integrity of the linting and type-checking processes ensures code quality and consistency throughout the codebase.-- In our project, we rely on several essential ESLint plugins, namely:- - [plugin:@typescript-eslint](https://typescript-eslint.io/rules/)- - [airbnb styleguide](https://github.com/airbnb/javascript)- - [plugin:sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)-- To ensure compliance with our coding standards and best practices, we encourage you to refer to the documentation of these plugins. Familiarizing yourself with the ESLint rules they provide will help maintain code quality and consistency throughout the project.+- In our project, we rely on several essential ESLint plugins and configurations:++ - [eslint:recommended](https://eslint.org/docs/latest/rules/) - Core ESLint rules for JavaScript best practices+ - [plugin:@typescript-eslint](https://typescript-eslint.io/rules/) - TypeScript-specific linting rules+ - [plugin:react](https://github.com/jsx-eslint/eslint-plugin-react) - React best practices and patterns+ - [plugin:react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks) - Rules of Hooks enforcement+ - [plugin:sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs) - Code quality and complexity analysis+ - [plugin:prettier](https://github.com/prettier/eslint-plugin-prettier) - Code formatting via Prettier+ - [simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) - Automatic import organization+ - [plugin:jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) - Accessibility rules for JSX elements++ To ensure compliance with our coding standards and best practices, we encourage you to refer to the documentation of these plugins. Familiarizing yourself with the ESLint rules they provide will help maintain code quality and consistency throughout the project.### Naming Conventionsdiff --git a/frontend/package.json b/frontend/package.jsonindex 41968c1cc7..4cc35855df 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -219,16 +219,11 @@"compression-webpack-plugin": "9.0.0","copy-webpack-plugin": "^11.0.0","eslint": "^7.32.0",- "eslint-config-airbnb": "^19.0.4",- "eslint-config-airbnb-typescript": "^16.1.4","eslint-config-prettier": "^8.3.0",- "eslint-config-standard": "^16.0.3","eslint-plugin-import": "^2.28.1","eslint-plugin-jest": "^26.9.0","eslint-plugin-jsx-a11y": "^6.5.1",- "eslint-plugin-node": "^11.1.0","eslint-plugin-prettier": "^4.0.0",- "eslint-plugin-promise": "^5.1.0","eslint-plugin-react": "^7.24.0","eslint-plugin-react-hooks": "^4.3.0","eslint-plugin-simple-import-sort": "^7.0.0",diff --git a/frontend/src/components/Graph/utils.ts b/frontend/src/components/Graph/utils.tsindex aaa6fccca8..9095ad2386 100644--- a/frontend/src/components/Graph/utils.ts+++ b/frontend/src/components/Graph/utils.ts@@ -1,4 +1,5 @@import { Chart, ChartConfiguration, ChartData, Color } from 'chart.js';+// eslint-disable-next-line import/namespace -- side-effect import that registers Chart.js date adapterimport * as chartjsAdapter from 'chartjs-adapter-date-fns';import { Timezone } from 'components/CustomTimePicker/timezoneUtils';import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';diff --git a/frontend/src/tests/test-utils.tsx b/frontend/src/tests/test-utils.tsxindex 1140d748af..7795352f52 100644--- a/frontend/src/tests/test-utils.tsx+++ b/frontend/src/tests/test-utils.tsx@@ -344,6 +344,8 @@ const customRender = (});};+// eslint-disable-next-line import/export -- re-exporting custom render alongside @testing-library/reactexport * from '@testing-library/react';export { default as userEvent } from '@testing-library/user-event';+// eslint-disable-next-line import/export -- custom render wraps the originalexport { customRender as render };