Skip to content

Commit 6f1bf5c

Browse files
Merge pull request #72 from conveyal/typescript
Add TypeScript, replace mastarm with tsdx
2 parents 6a89329 + 1ab8fb7 commit 6f1bf5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+9577
-10248
lines changed

.babelrc

-11
This file was deleted.

.eslintrc.js

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// this file was autogenerated by tsdx using the `yarn lint --write-file` command
2+
module.exports = {
3+
"extends": [
4+
"standard",
5+
"standard-jsx",
6+
"react-app",
7+
"plugin:@typescript-eslint/recommended",
8+
"plugin:react/recommended",
9+
"plugin:jest/recommended",
10+
"plugin:jsx-a11y/strict",
11+
"plugin:prettier/recommended",
12+
"prettier"
13+
],
14+
"parser": "@typescript-eslint/parser",
15+
"plugins": [
16+
"@typescript-eslint",
17+
"sort-keys-fix",
18+
"import",
19+
"jest",
20+
"jsx-a11y",
21+
"react",
22+
"sort-destructure-keys"
23+
],
24+
"rules": {
25+
"@typescript-eslint/member-delimiter-style": [
26+
"off",
27+
{
28+
"multiline": {
29+
"delimiter": "none",
30+
"requireLast": false
31+
},
32+
"singleline": {
33+
"delimiter": "comma",
34+
"requireLast": false
35+
}
36+
}
37+
],
38+
"@typescript-eslint/no-var-requires": 0,
39+
"complexity": [
40+
"warn",
41+
12
42+
],
43+
"import/order": [
44+
"warn",
45+
{
46+
"newlines-between": "always"
47+
}
48+
],
49+
"jsx-a11y/label-has-for": [
50+
2,
51+
{
52+
"allowChildren": false,
53+
"components": [
54+
"Label"
55+
],
56+
"required": {
57+
"every": [
58+
"id"
59+
]
60+
}
61+
}
62+
],
63+
"object-curly-spacing": 0,
64+
"prefer-const": [
65+
"warn",
66+
{
67+
"destructuring": "all",
68+
"ignoreReadBeforeAssign": false
69+
}
70+
],
71+
"prettier/prettier": [
72+
"error",
73+
{
74+
"semi": false,
75+
"singleQuote": true,
76+
"trailingComma": "none"
77+
}
78+
],
79+
"react/jsx-sort-props": [
80+
"error",
81+
{
82+
"ignoreCase": true
83+
}
84+
],
85+
"sort-destructure-keys/sort-destructure-keys": [
86+
"error",
87+
{
88+
"caseSensitive": false
89+
}
90+
],
91+
"sort-keys": [
92+
"error",
93+
"asc",
94+
{
95+
"caseSensitive": false
96+
}
97+
],
98+
"sort-keys-fix/sort-keys-fix": "warn",
99+
"sort-vars": [
100+
"error",
101+
{
102+
"ignoreCase": true
103+
}
104+
]
105+
},
106+
"settings": {
107+
"react": {
108+
"version": "detect"
109+
}
110+
}
111+
}

.github/workflows/node-ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ jobs:
2121
node-version: 12.x
2222
- name: Install npm packages using cache
2323
uses: bahmutov/npm-install@v1
24+
with:
25+
# the IBI Group TSDX fork has some dependency issues
26+
# that cause yarn install to fail on a ci runner. Disabling
27+
# concurrency allows installation to complete successfully
28+
install-command: yarn --frozen-lockfile --network-concurrency 1
2429
- name: Lint code
2530
run: yarn lint
2631
- name: Run tests with coverage
2732
run: yarn cover
2833

2934
# at this point, the build is successful
30-
- name: Codecov
31-
uses: codecov/[email protected]
32-
continue-on-error: true
3335
- name: Semantic Release
3436
env:
35-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3638
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3739
run: yarn semantic-release
3840

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ logs
1515
results
1616

1717
build
18+
dist
1819
node_modules
1920
components
2021
npm-debug.log

.storybook/main.js

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
const path = require('path')
2-
// your app's webpack.config.js
3-
const custom = require('./webpack.config.js');
4-
51
module.exports = {
6-
stories: ['../stories/*.stories.js'],
7-
addons: [
8-
'@storybook/addon-links',
9-
'@storybook/addon-essentials',
10-
'@storybook/preset-create-react-app'
11-
],
12-
// Ensures that, when running storybook, webpack rules (loaders for css, file,
13-
// etc.) from the custom config are used.
14-
webpackFinal: (config) => {
15-
return { ...config, module: { ...config.module, rules: custom.module.rules } };
16-
}
2+
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
3+
stories: ['../stories/*.stories.js']
174
}

.storybook/webpack.config.js

-72
This file was deleted.

__tests__/util/index.js __tests__/util/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* globals describe, expect, it */
22

3-
import {addVectors} from '../../lib/util'
3+
import { addVectors } from '../../lib/util'
44

55
describe('util', () => {
66
it('addVectors should work', () => {

0 commit comments

Comments
 (0)