Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.eslintrc.js
78 changes: 78 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"use strict";

module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},

parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
tsconfigRootDir: __dirname, // TODO: https://github.com/typescript-eslint/typescript-eslint/issues/251
useJSXTextNode: true,
},

plugins: ["@typescript-eslint", "prettier" ],

extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier",
],

rules: {
"prettier/prettier": [
"warn",
{
bracketSpacing: true,
printWidth: 120,
singleQuote: true,
tabWidth: 4,
trailingComma: "es5", // EcmaScript5 において、validな場合には末尾カンマを許可する
arrowParens: "always", // アロー関数の引数に対する括弧を必須にする
useTabs: false,
jsxBracketSameLine: false,
parser: "typescript",
},
],
"@typescript-eslint/no-namespace": "off",
// '@typescript-eslint/indent': 'off',
// '@typescript-eslint/interface-name-prefix': ['warn', 'always'],
// '@typescript-eslint/no-empty-interface': 'off',
// '@typescript-eslint/no-object-literal-type-assertion': 'off',
// '@typescript-eslint/no-unused-vars': 'warn',
// '@typescript-eslint/no-explicit-any': 'off',
// "@typescript-eslint/no-empty-function": [2, {"allow": ["arrowFunctions", "constructors"]}],
// // 'no-console': ['warn', { allow: ['error', 'warn'] }],
// // TSLintの例外対応
// '@typescript-eslint/array-type': 'warn', // 配列を[]で定義(Array<>は許可しない)
// '@typescript-eslint/camelcase': 'off', // キャメルケースを許可しない
// '@typescript-eslint/explicit-function-return-type': ['off'], // 関数の戻り値の型の指定
// '@typescript-eslint/explicit-member-accessibility': 'warn', // TODO: https://github.com/typescript-eslint/typescript-eslint/issues/214
// 'import/no-extraneous-dependencies': 'off', // package.jsonのdevDependencies import問題
// 'import/no-unresolved': 'off', // TODO: aliasの時だけ拡張子が解決出来ずエラーになるので対策
// 'import/order': 'off', // importの順序
// 'import/prefer-default-export': 'off', // exportが1つしかない場合はdefaultにする
// 'no-irregular-whitespace': ['error', { skipRegExps: true }], // 正規表現のみスペースの使用を許可する
// 'no-nested-ternary': 'off', // 三項演算子のネストを許可しない
},

settings: {
propWrapperFunctions: [
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
"forbidExtraProps",
{ property: "freeze", object: "Object" },
{ property: "myFavoriteWrapper" },
],
linkComponents: [
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
"Hyperlink",
{ name: "Link", linkAttribute: "to" },
],
},
};
116 changes: 116 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@

# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env*.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# End of https://www.toptal.com/developers/gitignore/api/node
4 changes: 4 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
image: gitpod/workspace-full

tasks:
- init: yarn install
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# オブジェクト指向モデリング勉強会 - サンプルコード

[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/levii/object-oriented-modeling)
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "object-oriented-modeling-samples",
"version": "0.0.1",
"devDependencies": {
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.1",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
},
"scripts": {
"eslint": "eslint src --ext .js,.jsx,.ts,.tsx",
"eslint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
"test": "jest --env=jsdom --silent=false"
},
"jest": {
"moduleFileExtensions": [
"js",
"ts"
],
"verbose": true,
"silent": false,
"testRegex": "[^/.]+\\.(test|spec)\\.(tsx?|jsx?)$",
"transform": {
"^.+\\.(ts)$": "ts-jest"
},
"globals": {
"ts-jest": {
"tsconfig": "tsconfig.json"
}
}
}
}
23 changes: 23 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"sourceMap": true,
"target": "es5",
"module": "es2015",
"jsx": "react",
"moduleResolution": "node",
"lib": [
"es2020",
"dom"
],
"allowSyntheticDefaultImports": true,
"typeRoots": [
"./node_modules/@types",
"./@types"
],
"types": [
"jest"
],
"baseUrl": "./src"
}
}
Loading