Skip to content

Commit

Permalink
Merge pull request #1809 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 773c5a5 + 8e61d09 commit 4b84b38
Show file tree
Hide file tree
Showing 11 changed files with 1,126 additions and 599 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

125 changes: 0 additions & 125 deletions .eslintrc.json

This file was deleted.

27 changes: 7 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,18 @@

version: 2
updates:
# repetitive because unfortunately Dependabot ticket for wildcard support still open:
# https://github.com/dependabot/dependabot-core/issues/2178
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: 'packages/authorization'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: 'packages/server'
directories:
- '/'
- 'packages/authorization'
- 'packages/server'
schedule:
interval: 'weekly'

- package-ecosystem: 'docker'
directory: 'packages/server/docker/server'
schedule:
interval: 'weekly'
# we want LTS version of NodeJS and not suggested current version
ignore:
- dependency-name: 'node'
update-types: ['version-update:semver-major']
- package-ecosystem: 'docker'
directory: 'packages/server/docker/swr-queue-worker'
directories:
- 'packages/server'
- 'packages/db-migrations'
schedule:
interval: 'weekly'
# we want LTS version of NodeJS and not suggested current version
Expand Down
1 change: 0 additions & 1 deletion esbuild-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ async function processAsync(src, filename) {
}
}

// eslint-disable-next-line import/no-default-export
export default { processAsync }
177 changes: 177 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import _import from 'eslint-plugin-import'
import react from 'eslint-plugin-react'
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 [
{
ignores: [
'packages/server/src/types.ts',
'packages/types/src/index.ts',
'**/transform-graphql-jest-28-shim.cjs',
],
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'prettier',
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
import: fixupPluginRules(_import),
react,
},

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/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-module-boundary-types': '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',
'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/no-deprecated': 'error',

'import/no-internal-modules': [
'error',
{
allow: [
'@pact-foundation/pact/src/dsl/matchers',
'msw/node',
'msw/lib/**',
'mysql2/promise',
'io-ts/lib/*',
'io-ts-types/lib/*',
'fp-ts/lib/*',
'ts-jest/utils',
'@apollo/server/plugin/disabled',
'@apollo/server/express4',
],
},
],

'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/prop-types': 'off',
},
},
{
files: [
'__fixtures__/**/*',
'__tests-pacts__/**/*',
'__tests__/**/*',
'**/jest.setup.ts',
'**/jest.setup-pacts.ts',
],

rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'import/no-extraneous-dependencies': 'off',
},
},
]
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-default-export
export default {
modulePaths: ['<rootDir>/packages'],
moduleNameMapper: {
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"graphql": "^16.9.0"
},
"devDependencies": {
"@eslint/compat": "^1.2.2",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@luckycatfactory/esbuild-graphql-loader": "^3.8.1",
"@tsconfig/node20": "^20.1.4",
"@types/jest": "^29.5.12",
Expand All @@ -97,11 +100,12 @@
"@typescript-eslint/parser": "^8.6.0",
"default-import": "^2.0.1",
"depcheck": "^1.4.7",
"esbuild": "^0.23.1",
"eslint": "^8.57.0",
"esbuild": "^0.24.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react": "^7.35.2",
"globals": "^15.12.0",
"graphql-tag": "^2.12.6",
"jest": "^29.7.0",
"jest-transform-graphql": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/db-migrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/uuid": "^10.0.0",
"depcheck": "^1.4.7",
"dotenv": "^16.4.5",
"esbuild": "^0.23.1",
"esbuild": "^0.24.0",
"fp-ts": "^2.16.9",
"io-ts": "^2.2.21",
"ioredis": "^5.4.1",
Expand Down
Loading

0 comments on commit 4b84b38

Please sign in to comment.