Skip to content

Commit

Permalink
Merge branch 'master' into search-improvements-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Nov 20, 2023
2 parents 5e35308 + a9528ad commit 4b64e1c
Show file tree
Hide file tree
Showing 599 changed files with 6,997 additions and 5,879 deletions.
55 changes: 31 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ module.exports = {
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:react/recommended',
'plugin:eslint-comments/recommended',
'plugin:storybook/recommended',
'prettier',
'plugin:compat/recommended',
'prettier',
],
globals,
parser: '@typescript-eslint/parser',
Expand All @@ -42,6 +42,7 @@ module.exports = {
},
ecmaVersion: 2018,
sourceType: 'module',
project: 'tsconfig.json'
},
plugins: ['prettier', 'react', 'cypress', '@typescript-eslint', 'no-only-tests', 'jest', 'compat', 'posthog'],
rules: {
Expand Down Expand Up @@ -72,7 +73,27 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/require-await': 'off', // TODO: Enable - this rule is useful, but doesn't have an autofix
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{
allowArgumentsExplicitlyTypedAsAny: true,
},
],
curly: 'error',
'no-restricted-imports': [
'error',
Expand Down Expand Up @@ -230,43 +251,29 @@ module.exports = {
...globals,
given: 'readonly',
},
rules: {
// The below complains needlessly about expect(api.createInvite).toHaveBeenCalledWith(...)
'@typescript-eslint/unbound-method': 'off',
}
},
{
// disable these rules for files generated by kea-typegen
files: ['*Type.ts', '*Type.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': ['off'],
'no-restricted-imports': 'off',
'@typescript-eslint/ban-types': ['off'],
},
},
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{
allowArgumentsExplicitlyTypedAsAny: true,
},
],
},
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
{
files: 'eslint-rules/**/*',
extends: ['eslint:recommended'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
- name: Check formatting with prettier
run: pnpm prettier:check

- name: Lint with ESLint
run: pnpm lint:js

- name: Lint with Stylelint
run: pnpm lint:css

- name: Generate logic types and run typescript with strict
run: pnpm typegen:write && pnpm typescript:check

- name: Lint with ESLint
run: pnpm lint:js

- name: Check if "schema.json" is up to date
run: pnpm schema:build:json && git diff --exit-code

Expand Down
9 changes: 9 additions & 0 deletions .run/Dev.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dev" type="CompoundRunConfigurationType">
<toRun name="PostHog" type="Python.DjangoServer" />
<toRun name="Frontend" type="js.build_tools.npm" />
<toRun name="Plugin Server" type="js.build_tools.npm" />
<toRun name="Celery" type="PythonConfigurationType" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

Updates to the PostHog project can be found on [https://posthog.com/changelog](our changelog).
Updates to the PostHog project can be found on [our changelog](https://posthog.com/changelog).
2 changes: 1 addition & 1 deletion cypress/e2e/actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const createAction = (actionName: string): void => {
cy.get('[data-attr=action-name-create]').should('exist')

cy.get('[data-attr=action-name-create]').type(actionName)
cy.get('.ant-radio-group > :nth-child(3)').click()
cy.get('.LemonSegmentedButton > ul > :nth-child(3)').click()
cy.get('[data-attr=edit-action-url-input]').click().type(Cypress.config().baseUrl)

Check failure on line 9 in cypress/e2e/actions.cy.ts

View workflow job for this annotation

GitHub Actions / Code quality checks

Argument of type 'string | null' is not assignable to parameter of type 'string'.

cy.get('[data-attr=save-action-button]').click()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/early-access-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Early Access Management', () => {
it('Early access feature new and list', () => {
// load an empty early access feature page
cy.get('h1').should('contain', 'Early Access Management')
cy.title().should('equal', 'Early Access Management • PostHog')
cy.title().should('equal', 'Early access features • PostHog')
cy.get('h2').should('contain', 'Create your first feature')
cy.get('[data-attr="product-introduction-docs-link"]').should(
'contain',
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/insights.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Insights', () => {

cy.get('[data-attr=breadcrumb-0]').should('contain', 'Hogflix')
cy.get('[data-attr=breadcrumb-1]').should('contain', 'Hogflix Demo App')
cy.get('[data-attr=breadcrumb-2]').should('have.text', 'Insights')
cy.get('[data-attr=breadcrumb-2]').should('have.text', 'Product analytics')
cy.get('[data-attr=breadcrumb-3]').should('have.text', 'insight name')
})

Expand Down
Loading

0 comments on commit 4b64e1c

Please sign in to comment.