Skip to content

Commit

Permalink
Merge pull request #72 from conveyal/typescript
Browse files Browse the repository at this point in the history
Add TypeScript, replace mastarm with tsdx
  • Loading branch information
binh-dam-ibigroup authored Oct 18, 2021
2 parents 6a89329 + 1ab8fb7 commit 6f1bf5c
Show file tree
Hide file tree
Showing 54 changed files with 9,577 additions and 10,248 deletions.
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

111 changes: 111 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// this file was autogenerated by tsdx using the `yarn lint --write-file` command
module.exports = {
"extends": [
"standard",
"standard-jsx",
"react-app",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jest/recommended",
"plugin:jsx-a11y/strict",
"plugin:prettier/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"sort-keys-fix",
"import",
"jest",
"jsx-a11y",
"react",
"sort-destructure-keys"
],
"rules": {
"@typescript-eslint/member-delimiter-style": [
"off",
{
"multiline": {
"delimiter": "none",
"requireLast": false
},
"singleline": {
"delimiter": "comma",
"requireLast": false
}
}
],
"@typescript-eslint/no-var-requires": 0,
"complexity": [
"warn",
12
],
"import/order": [
"warn",
{
"newlines-between": "always"
}
],
"jsx-a11y/label-has-for": [
2,
{
"allowChildren": false,
"components": [
"Label"
],
"required": {
"every": [
"id"
]
}
}
],
"object-curly-spacing": 0,
"prefer-const": [
"warn",
{
"destructuring": "all",
"ignoreReadBeforeAssign": false
}
],
"prettier/prettier": [
"error",
{
"semi": false,
"singleQuote": true,
"trailingComma": "none"
}
],
"react/jsx-sort-props": [
"error",
{
"ignoreCase": true
}
],
"sort-destructure-keys/sort-destructure-keys": [
"error",
{
"caseSensitive": false
}
],
"sort-keys": [
"error",
"asc",
{
"caseSensitive": false
}
],
"sort-keys-fix/sort-keys-fix": "warn",
"sort-vars": [
"error",
{
"ignoreCase": true
}
]
},
"settings": {
"react": {
"version": "detect"
}
}
}
10 changes: 6 additions & 4 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ jobs:
node-version: 12.x
- name: Install npm packages using cache
uses: bahmutov/npm-install@v1
with:
# the IBI Group TSDX fork has some dependency issues
# that cause yarn install to fail on a ci runner. Disabling
# concurrency allows installation to complete successfully
install-command: yarn --frozen-lockfile --network-concurrency 1
- name: Lint code
run: yarn lint
- name: Run tests with coverage
run: yarn cover

# at this point, the build is successful
- name: Codecov
uses: codecov/[email protected]
continue-on-error: true
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ logs
results

build
dist
node_modules
components
npm-debug.log
Expand Down
17 changes: 2 additions & 15 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
const path = require('path')
// your app's webpack.config.js
const custom = require('./webpack.config.js');

module.exports = {
stories: ['../stories/*.stories.js'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/preset-create-react-app'
],
// Ensures that, when running storybook, webpack rules (loaders for css, file,
// etc.) from the custom config are used.
webpackFinal: (config) => {
return { ...config, module: { ...config.module, rules: custom.module.rules } };
}
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
stories: ['../stories/*.stories.js']
}
72 changes: 0 additions & 72 deletions .storybook/webpack.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion __tests__/util/index.js → __tests__/util/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* globals describe, expect, it */

import {addVectors} from '../../lib/util'
import { addVectors } from '../../lib/util'

describe('util', () => {
it('addVectors should work', () => {
Expand Down
Loading

0 comments on commit 6f1bf5c

Please sign in to comment.