Skip to content

Commit 68f45cd

Browse files
committed
chore: use union config, add breaking notice, close #30
1 parent 04987b1 commit 68f45cd

File tree

7 files changed

+3595
-628
lines changed

7 files changed

+3595
-628
lines changed

.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"plugin:prettier/recommended",
4+
"plugin:mdx/recommended"
5+
]
6+
}

.github/workflows/nodejs.yml

+36-43
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,60 @@ name: Node CI
33
on: [push, pull_request]
44

55
jobs:
6-
build:
6+
default:
77
strategy:
88
matrix:
9-
node: [8.x, 10.x, 12.x]
9+
node: [12]
1010
os: [macOS-latest, ubuntu-latest]
1111
runs-on: ${{ matrix.os }}
1212
steps:
1313
- uses: actions/checkout@v1
14-
- name: Use Node.js ${{ matrix.node }}
15-
uses: actions/setup-node@v1
14+
- uses: actions/setup-node@v1
1615
with:
1716
node-version: ${{ matrix.node }}
18-
- name: setup yarn
17+
- name: Setup yarn
1918
run: |
2019
curl -o- -L https://yarnpkg.com/install.sh | bash
2120
export PATH="$HOME/.yarn/bin:$PATH"
22-
- name: build, lint, test
21+
- name: Install Dependencies
22+
run: yarn --frozen-lockfile
23+
24+
- name: Build, Lint and Test
2325
run: |
24-
yarn --frozen-lockfile
2526
yarn build
2627
yarn lint
27-
yarn eslint -f friendly tests/**/*.{ts,tsx}
28+
yarn test
2829
env:
29-
CI: true
30-
EFF_NO_LINK_RULES: true
31-
PARSER_NO_WATCH: true
32-
33-
# codecov:
34-
# runs-on: macOS-latest
35-
# needs: build
36-
# steps:
37-
# - name: Report Test Code Coverage
38-
# if: matrix.node == '12.x'
39-
# run: |
40-
# yarn global add codecov codacy-coverage
41-
# codecov
42-
# cat ./coverage/lcov.info | codacy-coverage
43-
# env:
44-
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30+
EFF_NO_LINK_RULES: 'true'
31+
PARSER_NO_WATCH: 'true'
4532

46-
deploy:
47-
runs-on: macOS-latest
48-
needs: build
49-
steps:
50-
- name: Publish Release and npm Package
51-
if: github.event_name == 'push' && github.ref == 'master' && matrix.node == '12.x'
52-
run: bash deploy.sh
33+
- name: Codecov
34+
if: matrix.os == 'macOS-latest'
35+
run: |
36+
yarn global add codecov codacy-coverage
37+
codecov
38+
cat ./coverage/lcov.info | codacy-coverage --username JounQin --projectName babel-preset-proposal-typescript
5339
env:
54-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
GH_BRANCH: ${{ github.ref }}
57-
GH_REPO: ${{ github.repository }}
40+
CI: 'true'
41+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
42+
CODACY_ACCOUNT_TOKEN: ${{ secrets.CODACY_ACCOUNT_TOKEN }}
43+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
5844

59-
codecheck:
60-
runs-on: macOS-latest
61-
needs: [build, deploy]
62-
steps:
63-
- name: Code Check
64-
if: matrix.node == '12.x'
45+
- name: Code Checks
46+
if: matrix.os == 'macOS-latest'
6547
run: |
66-
yarn add -D @codechecks/client @codechecks/build-size-watcher
67-
yarn codechecks
48+
yarn global add @codechecks/client @codechecks/build-size-watcher
49+
codechecks
6850
env:
51+
CI: 'true'
6952
CC_SECRET: ${{ secrets.CC_SECRET }}
53+
54+
- name: Publish GitHub Release and npm Package
55+
if: matrix.os == 'macOS-latest' && github.event_name == 'push' && github.ref == 'refs/heads/master'
56+
run: bash scripts/deploy.sh
57+
env:
58+
CI: 'true'
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
GH_BRANCH: master
61+
GH_REPO: ${{ github.repository }}
62+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,17 @@ This means you can:
2525

2626
## TOC <!-- omit in toc -->
2727

28+
- [Notice](#notice)
2829
- [Installation](#installation)
2930
- [Configuration](#configuration)
3031
- [Contributing](#contributing)
3132

33+
## Notice
34+
35+
After version 2.0.0, `.d.ts` will take higher priority then normal `.js` files on resolving `node_modules` packages in favor of `@types/*` definitions.
36+
37+
If you're facing some problems on rules `import/default` or `import/named` from [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import), do not post any issue here, because they are just working exactly as [expected](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/issues/31#issuecomment-539751607) on our sides, take <https://github.com/benmosher/eslint-plugin-import/issues/1525> as reference or post a new issue to [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) instead.
38+
3239
## Installation
3340

3441
```sh
@@ -62,29 +69,29 @@ Add the following to your `.eslintrc` config:
6269

6370
// use <root>/path/to/folder/tsconfig.json
6471
"typescript": {
65-
"directory": "./path/to/folder"
72+
"directory": "path/to/folder"
6673
},
6774

6875
// Multiple tsconfigs (Useful for monorepos)
6976

7077
// use a glob pattern
7178
"typescript": {
72-
"directory": "./packages/*/tsconfig.json"
79+
"directory": "packages/*/tsconfig.json"
7380
},
7481

7582
// use an array
7683
"typescript": {
7784
"directory": [
78-
"./packages/module-a/tsconfig.json",
79-
"./packages/module-b/tsconfig.json"
85+
"packages/module-a/tsconfig.json",
86+
"packages/module-b/tsconfig.json"
8087
]
8188
},
8289

8390
// use an array of glob patterns
8491
"typescript": {
8592
"directory": [
86-
"./packages/*/tsconfig.json",
87-
"./other-packages/*/tsconfig.json"
93+
"packages/*/tsconfig.json",
94+
"other-packages/*/tsconfig.json"
8895
]
8996
}
9097
}

package.json

+11-22
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"build:r": "r",
2929
"build:ts": "tsc -b",
3030
"lint": "run-p lint:*",
31-
"lint:es": "eslint src --ext md,js,ts -f friendly",
31+
"lint:es": "cross-env PARSER_NO_WATCH=true eslint src --ext md,js,ts -f friendly",
3232
"lint:tsc": "tsc --noEmit",
3333
"pretest": "r",
34-
"test": "eslint tests/**/*.{ts,tsx} -f friendly",
34+
"test": "cross-env PARSER_NO_WATCH=true eslint tests/**/*.{ts,tsx} -f friendly",
3535
"type-coverage": "type-coverage --cache --detail --ignore-catch --strict"
3636
},
3737
"peerDependencies": {
@@ -46,36 +46,25 @@
4646
"tsconfig-paths": "^3.9.0"
4747
},
4848
"devDependencies": {
49-
"@1stg/babel-preset": "^0.7.8",
50-
"@1stg/commitlint-config": "^0.1.0",
51-
"@1stg/eslint-config": "^0.12.21",
52-
"@1stg/husky-config": "^0.3.1",
53-
"@1stg/lint-staged": "^0.8.7",
54-
"@1stg/prettier-config": "^0.4.2",
55-
"@1stg/remark-config": "^0.2.2",
56-
"@1stg/tsconfig": "^0.6.0",
57-
"@babel/core": "^7.6.4",
58-
"@commitlint/cli": "^8.2.0",
59-
"@pkgr/rollup": "^0.2.5",
49+
"@1stg/lib-config": "^0.1.13",
50+
"@pkgr/rollup": "^0.8.2",
6051
"@types/debug": "^4.1.5",
6152
"@types/is-glob": "^4.0.1",
62-
"@types/node": "^12.11.1",
53+
"@types/node": "^12.12.7",
6354
"@types/resolve": "^0.0.8",
6455
"@types/unist": "^2.0.3",
6556
"dummy.js": "link:dummy.js",
66-
"eslint": "^6.5.1",
6757
"eslint-import-resolver-typescript": "link:.",
68-
"husky": "^3.0.9",
69-
"lint-staged": "^9.4.2",
7058
"npm-run-all": "^4.1.5",
71-
"prettier": "^1.18.2",
72-
"react": "^16.10.2",
73-
"rollup": "^1.24.0",
59+
"react": "^16.11.0",
7460
"type-coverage": "^2.3.0",
75-
"typescript": "^3.6.4"
61+
"typescript": "^3.7.2"
7662
},
7763
"resolutions": {
78-
"eslint-import-resolver-typescript": "link:."
64+
"@babel/core": "^7.7.2",
65+
"eslint-import-resolver-typescript": "link:.",
66+
"prettier": "^1.19.1",
67+
"rollup": "~1.25.2"
7968
},
8069
"typeCoverage": {
8170
"atLeast": 100

deploy.sh scripts/deploy.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
git remote set-url origin "https://user:$GH_TOKEN@github.com/$GH_REPO.git"
3+
git remote set-url origin "https://user:$GITHUB_TOKEN@github.com/$GH_REPO.git"
44
npm set //registry.npmjs.org/:_authToken "$NPM_TOKEN"
55

66
git fetch origin "$GH_BRANCH":"$GH_BRANCH"
@@ -9,8 +9,8 @@ git checkout "$GH_BRANCH"
99
PKG_VERSION=$(jq -r '.version' package.json)
1010

1111
git fetch origin v"$PKG_VERSION" || {
12-
yarn global add standard-version
13-
standard-version -a --release-as "$PKG_VERSION"
14-
git push --follow-tags origin "$GH_BRANCH"
15-
npm publish
12+
yarn global add standard-version
13+
standard-version -a --release-as "$PKG_VERSION"
14+
git push --follow-tags origin "$GH_BRANCH"
15+
npm publish
1616
}

src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
ConfigLoaderResult,
88
} from 'tsconfig-paths'
99
import globSync from 'tiny-glob/sync'
10-
1110
import isGlob from 'is-glob'
1211
import { isCore, sync } from 'resolve'
1312
import debug from 'debug'

0 commit comments

Comments
 (0)