Skip to content

Commit

Permalink
chore(replay): Use and extend monorepo's .eslintrc config (#6302)
Browse files Browse the repository at this point in the history
Use and extend the monorepo's eslint config in Replay's `eslintrc.js`. The config still contains a lot of overrides for temporarily disabled rules and replay-specific settings but we'll try to reduce these as we progress.
  • Loading branch information
Lms24 authored Nov 25, 2022
1 parent d825549 commit 3b7ce16
Showing 1 changed file with 11 additions and 39 deletions.
50 changes: 11 additions & 39 deletions packages/replay/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
// TODO: Remove this file after migration!
// TODO: Remove Sentry ESLint config package from package.json
// Note: All paths are relative to the directory in which eslint is being run, rather than the directory where this file
// lives

// ESLint config docs: https://eslint.org/docs/user-guide/configuring/

module.exports = {
root: true,
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
},
extends: ['@sentry-internal/sdk'],
extends: ['../../.eslintrc.js'],
ignorePatterns: [
'coverage/**',
'build/**',
Expand All @@ -31,16 +22,16 @@ module.exports = {
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.d.ts'],
files: ['worker/**/*.ts'],
parserOptions: {
project: ['tsconfig.json'],
// TODO: figure out if we need a worker-specific tsconfig
project: ['config/tsconfig.worker.json'],
},
},
// TODO: Extract this to package-specific config after mgiration
{
files: ['worker/**/*.ts'],
files: ['src/worker/**/*.js'],
parserOptions: {
project: ['./config/tsconfig.worker.json'],
sourceType: 'module',
},
},
{
Expand Down Expand Up @@ -86,6 +77,11 @@ module.exports = {
},
{
files: ['test/**/*.ts'],
parserOptions: {
// TODO: remove this parserOptions object after we added a tsconfig.test.json
// Replay previously didn't have a tsconfig.test.json, so for now we just the regular one.
project: ['tsconfig.json'],
},
rules: {
// TODO: decide if we want to keep our '@test' import paths
'import/no-unresolved': 'off',
Expand All @@ -96,29 +92,5 @@ module.exports = {
'@typescript-eslint/no-floating-promises': 'off',
},
},
{
files: ['src/worker/**/*.js'],
parserOptions: {
sourceType: 'module',
},
},
// ----------------
{
files: ['*.tsx'],
rules: {
// Turn off jsdoc on tsx files until jsdoc is fixed for tsx files
// See: https://github.com/getsentry/sentry-javascript/issues/3871
'jsdoc/require-jsdoc': 'off',
},
},
{
files: ['scenarios/**', 'rollup/**'],
parserOptions: {
sourceType: 'module',
},
rules: {
'no-console': 'off',
},
},
],
};

0 comments on commit 3b7ce16

Please sign in to comment.