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

Refactor all code #29

Closed
wants to merge 5 commits into from
Closed
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
12 changes: 10 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"presets": ["es2015"],
"plugins": ["transform-object-assign"]
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": ["last 2 versions"]
}
}
]
]
}
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:10

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn test
82 changes: 49 additions & 33 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": ["eslint:recommended", "google"],
"plugins": ["import"],
"rules": {
"arrow-parens": ["error", "as-needed"],
"no-underscore-dangle": "off",
"no-use-before-define": "off",
"no-confusing-arrow": "off",
"no-unused-vars": "off",
"no-plusplus": "off",
"no-else-return": "off",
"one-var": "off",
"require-jsdoc": "off",
"valid-jsdoc": "off",
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}],
"no-param-reassign": ["error", { "props": false }],
"indent": ["error", 4],
"max-len": "off",
"quotes": ["error", "double"],
"new-cap": "off",
"no-invalid-this": "off",
"no-console": "off",
},
"env": {
"browser": true
},
"globals": {
"d3": false,
"$": false
}
"plugins": ["jest", "@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/no-parameter-properties": "off",
"arrow-parens": ["error", "as-needed"],
"indent": ["error", 2],
"max-len": [
"warn",
{
"code": 100
}
],
"no-invalid-this": "warn",
"no-param-reassign": [
"error",
{
"props": false
}
],
"object-curly-spacing": ["error", "always"],
"quotes": ["error", "double"],
"require-jsdoc": "off",
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
]
},
"env": {
"browser": true,
"jest/globals": true
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/*
.DS_Store
yarn-error.log
54 changes: 0 additions & 54 deletions Gruntfile.js

This file was deleted.

113 changes: 113 additions & 0 deletions dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added dist/index.d.ts
Empty file.
3 changes: 3 additions & 0 deletions dist/lib/utils.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare function stringHash(s: string): number;
export declare function brightness(rgb: d3.RGBColor): number;
export declare function getReadableColorFor(color: string): string;
Loading