Skip to content

Commit

Permalink
Merge pull request #923 from serlo/staging
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
hugotiburtino authored Nov 14, 2024
2 parents 7b15d02 + 30ddd1e commit aa8b2d8
Show file tree
Hide file tree
Showing 114 changed files with 629 additions and 502 deletions.
117 changes: 0 additions & 117 deletions .eslintrc.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/msw-npm-2.4.3-d357f75dd0-bfbc9b5691.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions __tests__/frontend-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('reports to sentry when frontend responded with redirect', async () => {
const env = localTestEnvironment()
const redirectResponse = await env.fetch({
subdomain: 'en',
pathname: '/math',
pathname: '/api/.ory/login',
})

expect(redirectResponse.status).toEqual(302)
Expand All @@ -68,7 +68,7 @@ test('reports to sentry when frontend responded with redirect', async () => {
context: {
backendUrl: env.createUrl({
subdomain: 'frontend',
pathname: '/en/math',
pathname: '/api/.ory/login',
}),
location: 'https://frontend.serlo.org/',
},
Expand Down
166 changes: 166 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import _import from 'eslint-plugin-import'
import react from 'eslint-plugin-react'
import _deprecation from 'eslint-plugin-deprecation'
import { fixupPluginRules } from '@eslint/compat'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default [
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'prettier',
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
import: fixupPluginRules(_import),
react,
deprecation: fixupPluginRules(_deprecation),
},

languageOptions: {
globals: {
...globals.browser,
...globals.jest,
...globals.node,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: 'commonjs',

parserOptions: {
project: ['tsconfig.json'],
},
},

settings: {
react: {
pragma: 'h',
version: '16.8',
},
},

rules: {
'no-duplicate-imports': 'error',
'no-unused-vars': 'off',
'no-console': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-this-alias': 'warn',

'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],

'@typescript-eslint/no-use-before-define': [
'error',
{
classes: false,
functions: false,
typedefs: false,
},
],

'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'deprecation/deprecation': 'warn',
'import/export': 'error',

'import/extensions': [
'error',
'never',
{
json: 'always',
},
],

'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-absolute-path': 'error',
'import/no-commonjs': 'error',
'import/no-cycle': 'error',
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',
'import/no-deprecated': 'error',

'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'__stories__/**/*',
'__tests-pacts__/**/*',
'__tests__/**/*',
'scripts/**/*',
'jest.setup.ts',
'webpack.config.js',
],

optionalDependencies: false,
},
],

'import/no-internal-modules': [
'error',
{
allow: ['msw/node'],
},
],

'import/no-mutable-exports': 'error',
'import/no-self-import': 'error',
'import/no-unassigned-import': 'error',

'import/no-useless-path-segments': [
'error',
{
noUselessIndex: true,
},
],

'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},

groups: [
['builtin', 'external', 'internal'],
['parent', 'sibling', 'index', 'unknown'],
],

'newlines-between': 'always',
},
],

'react/jsx-boolean-value': 'error',
'react/jsx-curly-brace-presence': 'error',
'react/jsx-fragments': ['error', 'syntax'],
'react/prop-types': 'off',
},
},
]
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,39 @@
"toucan-js": "^4.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241018.0",
"@cloudflare/workers-types": "^4.20241106.0",
"@eslint/compat": "^1.2.2",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@iarna/toml": "^2.2.5",
"@jest/globals": "^29.7.0",
"@sentry/types": "^8.35.0",
"@testing-library/jest-dom": "^6.5.0",
"@sentry/types": "^8.36.0",
"@testing-library/jest-dom": "^6.6.3",
"@types/iarna__toml": "^2.0.5",
"@types/jest": "^29.5.14",
"@typescript-eslint/eslint-plugin": "^8.12.0",
"@typescript-eslint/parser": "^8.11.0",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.14.0",
"cross-env": "^7.0.3",
"depcheck": "^1.4.7",
"eslint": "^8.57.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react": "^7.37.2",
"globals": "^15.12.0",
"jest": "^29.7.0",
"msw": "^2.4.3",
"msw": "^2.6.4",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"prettier-plugin-sh": "^0.14.0",
"ts-jest": "^29.2.5",
"ts-unused-exports": "^10.1.0",
"typescript": "^5.6.2",
"wrangler": "^3.80.3"
"typescript": "^5.6.3",
"wrangler": "^3.86.1"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.0.0"
"node": "^20.0.0"
}
}
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { robotsTxt } from './robots'
import { sentryHelloWorld } from './sentry'
import { SentryFactory, CFEnvironment } from './utils'

// eslint-disable-next-line import/no-default-export
export default {
async fetch(
request: Request,
Expand Down
Loading

0 comments on commit aa8b2d8

Please sign in to comment.