Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a base backend package with all the configuration files #10

Closed
wants to merge 15 commits into from
Closed
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ dist

# TernJS port file
.tern-port

# PHPSTORM
.idea

# Typescript Build
lib
37 changes: 37 additions & 0 deletions backend/base-backend-package/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"standard",
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"ignorePatterns": ["node_modules/*", "lib/*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"prettier",
"@typescript-eslint",
"jest"
],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"no-underscore-dangle": "off"
}
}

7 changes: 7 additions & 0 deletions backend/base-backend-package/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"bracketSpacing": true
}
7 changes: 7 additions & 0 deletions backend/base-backend-package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Base Backend Package

This package provides the base setup to build a new backend package at Buffer:
- ESlint + Prettier
- TypeScript
- Jest
- Package commands
12 changes: 12 additions & 0 deletions backend/base-backend-package/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Config } from '@jest/types'

const config: Config.InitialOptions = {
verbose: true,
modulePathIgnorePatterns: ['node_modules/'],
preset: 'ts-jest',
setupFilesAfterEnv: ['./jest.env.ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
}

export default config
1 change: 1 addition & 0 deletions backend/base-backend-package/jest.env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.FOO = 'bar'
Loading