Skip to content

Commit 5c26f0f

Browse files
authored
Merge pull request #16 from infctr/ts
Rewrite to typescript
2 parents e9a5aa8 + 066fa23 commit 5c26f0f

Some content is hidden

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

55 files changed

+6524
-3187
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
tests/fixtures/**
2+
dist
3+
lib
4+
build

.eslintrc.js

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,61 @@
11
module.exports = {
2-
parserOptions: {
3-
sourceType: 'module',
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint', 'eslint-plugin', 'import', 'jest', 'prettier'],
5+
env: {
6+
es6: true,
7+
node: true,
48
},
59
extends: [
6-
'airbnb-base',
7-
'prettier/standard',
10+
'eslint:recommended',
11+
'plugin:import/errors',
12+
'plugin:import/warnings',
13+
'plugin:import/typescript',
14+
'plugin:@typescript-eslint/eslint-recommended',
15+
'plugin:@typescript-eslint/recommended',
16+
'plugin:eslint-plugin/all',
817
'plugin:prettier/recommended',
9-
'plugin:node/recommended',
18+
'prettier/@typescript-eslint',
1019
],
20+
parserOptions: {
21+
ecmaVersion: 10,
22+
project: ['./tsconfig.json', './tests/tsconfig.json'],
23+
sourceType: 'module',
24+
},
1125
rules: {
12-
'object-shorthand': 0,
26+
'no-console': 'warn',
27+
28+
'@typescript-eslint/explicit-function-return-type': 'off',
29+
'@typescript-eslint/ban-ts-ignore': 'off',
30+
'@typescript-eslint/no-explicit-any': 'off',
1331
},
1432
overrides: [
1533
{
1634
files: ['tests/**'],
1735
env: {
1836
jest: true,
1937
},
38+
rules: {
39+
'jest/no-disabled-tests': 'warn',
40+
'jest/no-focused-tests': 'error',
41+
'jest/no-alias-methods': 'error',
42+
'jest/no-identical-title': 'error',
43+
'jest/no-jasmine-globals': 'error',
44+
'jest/no-jest-import': 'error',
45+
'jest/no-test-prefixes': 'error',
46+
'jest/no-test-callback': 'error',
47+
'jest/no-test-return-statement': 'error',
48+
'jest/prefer-to-have-length': 'warn',
49+
'jest/prefer-spy-on': 'error',
50+
'jest/valid-expect': 'error',
51+
},
2052
},
2153
],
22-
};
54+
settings: {
55+
'import/resolver': {
56+
node: {
57+
moduleDirectory: ['node_modules', 'src'],
58+
},
59+
},
60+
},
61+
}

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
node-version: 12
2929
registry-url: https://registry.npmjs.org/
3030
- run: yarn
31+
- run: yarn compile
3132
- run: npm publish
3233
env:
3334
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/tests.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,25 @@ name: Tests
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [master]
99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
strategy:
1817
matrix:
1918
node-version: [10.x, 12.x]
2019

2120
steps:
22-
- uses: actions/checkout@v2
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
- run: yarn
28-
- run: yarn test
29-
env:
30-
CI: true
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: yarn
27+
- run: yarn verify
28+
env:
29+
CI: true

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,11 @@ typings/
8080

8181
# DynamoDB Local files
8282
.dynamodb/
83+
84+
# IDE
85+
.vscode
86+
87+
# Build artifacts
88+
dist
89+
build
90+
lib

.huskyrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
hooks: {
3+
'pre-commit': 'lint-staged',
4+
},
5+
}

.npmignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
tests/fixtures/**
2+
build
3+
dist
4+
lib

.prettierrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module.exports = {
2+
printWidth: 90,
23
trailingComma: 'all',
34
arrowParens: 'avoid',
4-
};
5+
semi: false,
6+
}

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.0] - 2020-05-22
9+
10+
### Changed
11+
12+
- Rewrite to typescript with strong types
13+
- Leverage helpers and types from @typescript-eslint/experimental-utils
14+
- Run autofix tests with ESLint Class rather than spawn a child process for eslint runner
15+
- Heavy refactoring and remove code paths that were never taken
16+
- Update ESLint config
17+
- Update to ESLint v7.0.0
18+
- Update dependencies
19+
20+
### Added
21+
22+
- Follow semver
23+
- Rollup bundler
24+
825
## [0.10.0] - 2020-05-21
926

1027
### Added

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ Then configure the rules you want to use under the rules section.
5555
}
5656
```
5757

58+
Or enable all rules with defaults
59+
60+
```json
61+
{
62+
"extends": ["plugin:typescript-sort-keys/recommended"]
63+
}
64+
```
65+
5866
## Supported Rules
5967

6068
<!-- begin rule list -->

babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' } }],
4+
'@babel/preset-typescript',
5+
],
6+
}

0 commit comments

Comments
 (0)