mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-11-03 00:53:53 +00:00
# Conflicts: # .github/workflows/check-insights-major-version.yml # .github/workflows/check-posthog-major-version.yml # .github/workflows/ci-security.yaml # .github/workflows/validate-versioning.yml # AGENTS.md # AGENTS.md~upstream_main # packages/ai/src/otel/capture.ts # packages/ai/src/otel/mappers/aiSdk.ts # packages/ai/src/otel/mappers/index.ts # packages/ai/src/otel/types.ts # packages/core/src/__tests__/posthog.init.spec.ts # packages/react-native/src/PostHogProvider.tsx # packages/react/src/context/PostHogContext.ts # packages/react/src/context/PostHogProvider.tsx # tooling/eslint-plugin-insights/no-unsafe-web-global.js
104 lines
3.3 KiB
JavaScript
104 lines
3.3 KiB
JavaScript
module.exports = {
|
|
overrides: [
|
|
{
|
|
files: './src/**/*',
|
|
rules: {
|
|
'no-restricted-globals': ['error', 'document', 'window'],
|
|
'no-restricted-syntax': [
|
|
'error',
|
|
{
|
|
selector: 'TSEnumDeclaration',
|
|
message:
|
|
'Enums add significant bundle bloat. Use a const object with `as const` and a type union instead. Example: `const Foo = { A: "a", B: "b" } as const; type Foo = (typeof Foo)[keyof typeof Foo];`',
|
|
},
|
|
],
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 2018,
|
|
sourceType: 'module',
|
|
project: true,
|
|
},
|
|
},
|
|
{
|
|
files: './src/__tests__/**/*',
|
|
// the same set of config as in the root
|
|
// but excluding the 'plugin:compat/recommended' rule
|
|
// we don't mind using the latest features in our tests
|
|
// extends: extend.filter((s) => s !== 'plugin:compat/recommended'),
|
|
rules: {
|
|
'no-console': 'off',
|
|
'no-restricted-globals': 'off',
|
|
'compat/compat': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: './playground/cypress/**/*',
|
|
globals: {
|
|
cy: true,
|
|
Cypress: true,
|
|
},
|
|
},
|
|
{
|
|
files: './testcafe/**/*',
|
|
globals: {
|
|
__dirname: true,
|
|
fixture: true,
|
|
},
|
|
env: {
|
|
node: true,
|
|
},
|
|
},
|
|
{
|
|
files: './playwright/**/*',
|
|
rules: {
|
|
'@hanzo/insights/no-direct-array-check': 'off',
|
|
'@hanzo/insights/no-direct-undefined-check': 'off',
|
|
'@hanzo/insights/no-direct-null-check': 'off',
|
|
'@typescript-eslint/naming-convention': 'off',
|
|
'compat/compat': 'off',
|
|
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
'no-empty-pattern': 'off',
|
|
'@typescript-eslint/no-empty-object-type': 'off',
|
|
},
|
|
env: {
|
|
node: true,
|
|
},
|
|
parserOptions: {
|
|
project: true,
|
|
},
|
|
},
|
|
{
|
|
files: './playwright/mock-server.mjs',
|
|
rules: {
|
|
'no-console': 'off',
|
|
},
|
|
env: {
|
|
node: true,
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 2018,
|
|
sourceType: 'module',
|
|
project: true,
|
|
},
|
|
},
|
|
{
|
|
files: './playground/**/*',
|
|
rules: {
|
|
'no-console': 'off',
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
'no-undef': 'off',
|
|
'@hanzo/insights/no-direct-array-check': 'off',
|
|
'@hanzo/insights/no-direct-undefined-check': 'off',
|
|
'@hanzo/insights/no-direct-null-check': 'off',
|
|
},
|
|
env: {
|
|
node: true,
|
|
},
|
|
parserOptions: {
|
|
project: null,
|
|
},
|
|
},
|
|
],
|
|
ignorePatterns: ['./playground/error-tracking/**/*', '**/test_fixtures/**'],
|
|
}
|