Skip to content

Commit 2cf1aba

Browse files
committed
Initial commit
0 parents  commit 2cf1aba

17 files changed

+6723
-0
lines changed

.codeclimate.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# XXX See https://docs.codeclimate.com/docs/advanced-configuration
2+
version: "2"
3+
checks:
4+
argument-count:
5+
enabled: true
6+
config:
7+
threshold: 4
8+
complex-logic:
9+
enabled: true
10+
config:
11+
threshold: 4
12+
file-lines:
13+
enabled: true
14+
config:
15+
threshold: 400 # 250 by default
16+
method-complexity:
17+
enabled: true
18+
config:
19+
threshold: 5
20+
method-count:
21+
enabled: true
22+
config:
23+
threshold: 20
24+
method-lines:
25+
enabled: true
26+
config:
27+
threshold: 100 # 25 by default
28+
nested-control-flow:
29+
enabled: true
30+
config:
31+
threshold: 4
32+
return-statements:
33+
enabled: true
34+
config:
35+
threshold: 4
36+
37+
plugins:
38+
# eslint: # https://docs.codeclimate.com/docs/eslint
39+
# enabled: true
40+
# channel: "eslint-4" # Depends on installed ESLint version - See https://docs.codeclimate.com/docs/eslint#section-eslint-versions
41+
duplication: # https://docs.codeclimate.com/docs/duplication
42+
enabled: true
43+
config:
44+
languages:
45+
javascript:
46+
mass_threshold: 80 # Instead of 50 - See https://docs.codeclimate.com/docs/duplication#section-understand-the-engine
47+
fixme: # https://docs.codeclimate.com/docs/fixme
48+
enabled: true
49+
config:
50+
strings: # Skip "XXX" as we don't use it for things to fix but rather for highlighting comments (DX)
51+
- FIXME
52+
- BUG
53+
- TODO
54+
- HACK
55+
git-legal: # https://docs.codeclimate.com/docs/git-legal
56+
enabled: true
57+
# tslint: # https://docs.codeclimate.com/docs/tslint TODO configure tslint if needed
58+
# enabled: true
59+
# config: tslint.json
60+
61+
# See https://docs.codeclimate.com/docs/excluding-files-and-folders
62+
exclude_patterns:
63+
- "**/*.test.*"
64+
- "**/*.spec.*"
65+
- "mocks/"
66+
- "lib/"
67+
- "examples/"
68+
69+
# Default CC excluded paths:
70+
- "config/"
71+
- "db/"
72+
- "dist/"
73+
- "features/"
74+
- "**/node_modules/"
75+
- "script/"
76+
- "**/spec/"
77+
- "**/test/"
78+
- "**/tests/"
79+
- "**/vendor/"
80+
- "**/*.d.ts"

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/node_modules/**
2+
/lib/**
3+
/coverage/**
4+
src/**/*.test*

.eslintrc.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
env:
3+
browser: true
4+
commonjs: true
5+
es6: true
6+
node: true
7+
extends:
8+
- plugin:@typescript-eslint/recommended
9+
globals:
10+
Atomics: readonly
11+
SharedArrayBuffer: readonly
12+
plugins:
13+
- jest
14+
parser: '@typescript-eslint/parser'
15+
parserOptions:
16+
project: ./tsconfig.json
17+
settings:
18+
react:
19+
version: detect
20+
rules: # See https://eslint.org/docs/rules
21+
semi:
22+
- error
23+
- always # Always put commas, to avoid multilines git diff when new lines are added
24+
quotes:
25+
- error
26+
- single # Prefer simple quotes
27+
- allowTemplateLiterals: true # Allow the use of `` instead of '' and don't try to replace it, even when `` isn't needed
28+
comma-spacing:
29+
- error
30+
- before: false
31+
after: true
32+
indent:
33+
- error
34+
- 2
35+
- SwitchCase: 1
36+
arrow-parens:
37+
- error
38+
- always
39+
max-len: 0 # Disable line length checks, because the IDE is already configured to warn about it, and it's a waste of time to check for lines that are too long, especially in comments (like this one!)
40+
strict: 'off'
41+
no-console: 1 # Shouldn't use "console", but "logger" instead
42+
allowArrowFunctions: 0
43+
no-unused-vars:
44+
- warn # Warn otherwise it false-positive with needed React imports
45+
- args: none # Allow to declare unused variables in function arguments, meant to be used later
46+
import/prefer-default-export: 0 # When there is only a single export from a module, don't enforce a default export, but rather let developer choose what's best
47+
no-else-return: 0 # Don't enforce, let developer choose. Sometimes we like to specifically use "return" for the sake of comprehensibility and avoid ambiguity
48+
no-underscore-dangle: 0 # Allow _ before/after variables and functions, convention for something meant to be "private"
49+
arrow-body-style: 0 # Don't enforce, let developer choose. Sometimes we like to specifically use "return" for ease of debugging and printing
50+
quote-props:
51+
- warn
52+
- consistent-as-needed # Enforce consistency with quotes on props, either all must be quoted, or all unquoted for a given object
53+
no-return-await: 0 # Useful before, but recent node.js enhancements make it useless on node 12+ (we use 10, but still, for consistency) - Read https://stackoverflow.com/questions/44806135/why-no-return-await-vs-const-x-await
54+
no-extra-boolean-cast: 0 # Don't enforce, let developer choose. Using "!!!" is sometimes useful (edge cases), and has a semantic value (dev intention)
55+
object-curly-newline:
56+
- warn
57+
- ObjectExpression:
58+
multiline: true
59+
minProperties: 5
60+
consistent: true
61+
ObjectPattern:
62+
multiline: true
63+
minProperties: 5
64+
consistent: true
65+
ImportDeclaration:
66+
multiline: true
67+
minProperties: 8 # Doesn't play so well with webstorm, which wraps based on the number of chars in the row, not based on the number of props #sucks
68+
consistent: true
69+
ExportDeclaration:
70+
multiline: true
71+
minProperties: 5
72+
consistent: true
73+
linebreak-style:
74+
- error
75+
- unix
76+
'@typescript-eslint/ban-ts-ignore': warn
77+
'@typescript-eslint/no-use-before-define': warn

.gitignore

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
2+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
3+
4+
# User-specific stuff
5+
.idea/**/workspace.xml
6+
.idea/**/tasks.xml
7+
.idea/**/usage.statistics.xml
8+
.idea/**/dictionaries
9+
.idea/**/shelf
10+
11+
# Generated files
12+
.idea/**/contentModel.xml
13+
14+
# Sensitive or high-churn files
15+
.idea/**/dataSources/
16+
.idea/**/dataSources.ids
17+
.idea/**/dataSources.local.xml
18+
.idea/**/sqlDataSources.xml
19+
.idea/**/dynamic.xml
20+
.idea/**/uiDesigner.xml
21+
.idea/**/dbnavigator.xml
22+
23+
# Gradle
24+
.idea/**/gradle.xml
25+
.idea/**/libraries
26+
27+
# Gradle and Maven with auto-import
28+
# When using Gradle or Maven with auto-import, you should exclude module files,
29+
# since they will be recreated, and may cause churn. Uncomment if using
30+
# auto-import.
31+
# .idea/modules.xml
32+
# .idea/*.iml
33+
# .idea/modules
34+
35+
# CMake
36+
cmake-build-*/
37+
38+
# Mongo Explorer plugin
39+
.idea/**/mongoSettings.xml
40+
41+
# File-based project format
42+
*.iws
43+
44+
# IntelliJ
45+
out/
46+
47+
# mpeltonen/sbt-idea plugin
48+
.idea_modules/
49+
50+
# JIRA plugin
51+
atlassian-ide-plugin.xml
52+
53+
# Cursive Clojure plugin
54+
.idea/replstate.xml
55+
56+
# Crashlytics plugin (for Android Studio and IntelliJ)
57+
com_crashlytics_export_strings.xml
58+
crashlytics.properties
59+
crashlytics-build.properties
60+
fabric.properties
61+
62+
# Editor-based Rest Client
63+
.idea/httpRequests
64+
65+
# Android studio 3.1+ serialized cache file
66+
.idea/caches/build_file_checksums.ser
67+
68+
# Logs
69+
logs
70+
*.log
71+
npm-debug.log*
72+
yarn-debug.log*
73+
yarn-error.log*
74+
75+
# Runtime data
76+
pids
77+
*.pid
78+
*.seed
79+
*.pid.lock
80+
81+
# Directory for instrumented libs generated by jscoverage/JSCover
82+
lib-cov
83+
84+
# Coverage directory used by tools like istanbul
85+
coverage
86+
87+
# nyc test coverage
88+
.nyc_output
89+
90+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
91+
.grunt
92+
93+
# Bower dependency directory (https://bower.io/)
94+
bower_components
95+
96+
# node-waf configuration
97+
.lock-wscript
98+
99+
# Compiled binary addons (https://nodejs.org/api/addons.html)
100+
build/Release
101+
102+
# Dependency directories
103+
node_modules/
104+
jspm_packages/
105+
106+
# TypeScript v1 declaration files
107+
typings/
108+
109+
# Optional npm cache directory
110+
.npm
111+
112+
# Optional eslint cache
113+
.eslintcache
114+
115+
# Optional REPL history
116+
.node_repl_history
117+
118+
# Output of 'npm pack'
119+
*.tgz
120+
121+
# Yarn Integrity file
122+
.yarn-integrity
123+
124+
# Ignore build directory (will be packed in the npm release, but shouldn't be tracked within git)
125+
/lib

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v12.14.0

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- "12.14"
4+
cache:
5+
directories:
6+
- node_modules
7+
install:
8+
- yarn install
9+
script:
10+
- yarn run test:once

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CHANGELOG
2+
===
3+
4+
- v1.0.? - 2019-07-17
5+
- [Enhancement] TODO

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Unly
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)