Skip to content

Commit

Permalink
Merge pull request #25 from catc/rewrite
Browse files Browse the repository at this point in the history
Timekeeper 2.0
  • Loading branch information
catc authored Sep 24, 2019
2 parents 0022a33 + 7cc6587 commit f547a5b
Show file tree
Hide file tree
Showing 108 changed files with 16,836 additions and 5,049 deletions.
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

36 changes: 36 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const isProd = process.env.NODE_ENV === 'production'

const config = {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
">0.5%",
"not ie 11",
"not op_mini all"
]
}
}
],
"@babel/preset-typescript",
"@babel/preset-react",
"@emotion/babel-preset-css-prop"
],
"plugins": [
'@babel/plugin-transform-runtime',
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
},
]
]
}

if (!isProd){
config.plugins.push('react-hot-loader/babel')
}

module.exports = config
70 changes: 0 additions & 70 deletions .eslintrc

This file was deleted.

162 changes: 162 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"useJSXTextNode": true,
"project": "./tsconfig.json",
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',

// react
'plugin:react/recommended',

// ts
'plugin:@typescript-eslint/recommended',

// prettier
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
'prettier',
'prettier/react',
'prettier/standard',
],
plugins: [
'react',
'react-hooks',
'import',
'@typescript-eslint',
'prettier',
],
env: {
browser: true,
node: true,
jest: true,
},
rules: {
// prettier
'prettier/prettier': 1,

// imports
'import/newline-after-import': 1,
'import/first': 2,
'import/imports-first': 2,
'import/no-unresolved': 0, // let typescript handle imports

// typescript
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': [0],
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-use-before-define': [2, { functions: false}],
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,

// react hooks
'react-hooks/rules-of-hooks': 1,
'react-hooks/exhaustive-deps': 1,

// react
'react/require-default-props': 1,
// 'react/no-find-dom-node': 1,
// 'react/jsx-no-target-blank': 2,
'react/no-array-index-key': 1,
'react/jsx-curly-brace-presence': 1,
'react/no-typos': 'warn',
// TODO - breaks jsx with prettier sometimes? investigate
// 'react/jsx-wrap-multilines': [
// 1,
// {
// declaration: 'parens-new-line',
// assignment: 'parens-new-line',
// return: 'parens-new-line',
// arrow: 'parens-new-line',
// condition: 'parens-new-line',
// logical: 'parens-new-line',
// prop: 'parens-new-line',
// },
// ],
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-tag-spacing': [
'error',
{
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
beforeClosing: 'never',
},
],

// standard eslint
'quote-props': [1, 'as-needed'],
'eol-last': 1,
curly: 2,
eqeqeq: [1, 'smart'],
'no-eval': 2,
'no-use-before-define': [1, 'nofunc'],
quotes: [
1,
'single',
{
allowTemplateLiterals: true,
},
],
indent: [
2,
'tab',
{
SwitchCase: 1,
},
],
'no-trailing-spaces': 1,
// 'function-paren-newline': [1, 'multiline'], // breaks js?? investigate
'keyword-spacing': [
1,
// space between `ifHERE()HERE{}`
{
before: true,
after: true,
},
],
'object-curly-spacing': [1, 'always'],
'no-var': 1,

'space-before-function-paren': [
1,
{
anonymous: 'never',
named: 'never',
asyncArrow: 'ignore',
},
],
// 'comma-dangle': [1, 'always-multiline'], // conflicts with prettier
'space-in-parens': [1, 'never'],
},
globals: {
window: true,
document: true,
localStorage: true,
FormData: true,
FileReader: true,
Blob: true,
navigator: true,
},
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ node_modules/
lib/

.DS_Store
.awcache/

# temp/testing
__*
z_old/
z_temp/
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
arrowParens: "always",
bracketSpacing: true,
jsxBracketSameLine: false,
printWidth: 100,
proseWrap: "preserve",
requirePragma: false,
semi: false,
singleQuote: true,
tabWidth: 4,
trailingComma: "all",
useTabs: true
}
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
node_js:
- 10.16.0

install:
- npm install
- npm install --no-save [email protected] [email protected]

script:
- npm run tests
Loading

0 comments on commit f547a5b

Please sign in to comment.