Skip to content

Commit 09390a2

Browse files
authored
chore: add type-coverage and codechecks support (#39)
1 parent b0b288e commit 09390a2

File tree

10 files changed

+73
-6
lines changed

10 files changed

+73
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ lib
33
node_modules
44
tsconfig.tsbuildinfo
55
.changelog
6+
.type-coverage
67
*.log

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ deploy:
4545
script: yarn run lerna publish --canary --conventional-prerelease --force-publish --preid beta --pre-dist-tag beta --yes
4646
on:
4747
branch: develop
48+
49+
after_script:
50+
- yarn add -D @codechecks/client @codechecks/build-size-watcher @codechecks/type-coverage-watcher -W
51+
- yarn codechecks

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-mdx.svg)](https://travis-ci.com/rx-ts/eslint-mdx)
1414
[![Codecov](https://img.shields.io/codecov/c/gh/rx-ts/eslint-mdx)](https://codecov.io/gh/rx-ts/eslint-mdx)
15+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/rx-ts/eslint-mdx)
1516
[![GitHub release](https://img.shields.io/github/release/rx-ts/eslint-mdx)](https://github.com/rx-ts/eslint-mdx/releases)
1617
[![David Dev](https://img.shields.io/david/dev/rx-ts/eslint-mdx.svg)](https://david-dm.org/rx-ts/eslint-mdx?type=dev)
1718
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
1819
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1920
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org)
21+
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io)
2022

2123
> [ESLint] Parser/Plugin for [MDX], helps you lint all ES syntaxes excluding `code` block of course.
2224
> Work perfectly with `eslint-plugin-import`, `eslint-plugin-prettier` or any other eslint plugins.

codechecks.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
checks:
2+
- name: build-size-watcher
3+
options:
4+
name: 'eslint-mdx pkg size'
5+
files:
6+
- path: 'packages/eslint-mdx/lib/**/*.*'
7+
- name: build-size-watcher
8+
options:
9+
name: '@rxts/eslint-plugin-mdx pkg size'
10+
files:
11+
- path: 'packages/eslint-plugin-mdx/lib/**/*.*'
12+
- name: type-coverage-watcher
13+
options:
14+
ignoreCatch: true
15+
ignoreFiles:
16+
- '*.d.ts'
17+
strict: true

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"scripts": {
1313
"build": "tsc -b",
1414
"test": "ts-node -T node_modules/.bin/jest",
15-
"lint": "EFF_NO_LINK_RULES=true eslint . --ext js,mdx,ts,tsx -f friendly"
15+
"lint": "EFF_NO_LINK_RULES=true eslint . --ext js,mdx,ts,tsx -f friendly",
16+
"type-coverage": "type-coverage --cache --ignore-catch --detail --ignore-files *.d.ts --strict"
1617
},
1718
"devDependencies": {
1819
"@commitlint/config-conventional": "^8.1.0",
@@ -40,6 +41,7 @@
4041
"react": "^16.9.0",
4142
"ts-jest": "^24.0.2",
4243
"ts-node": "^8.3.0",
44+
"type-coverage": "^2.2.0",
4345
"typescript": "^3.5.3"
4446
},
4547
"commitlint": {
@@ -89,5 +91,8 @@
8991
"extends": [
9092
"1stg"
9193
]
94+
},
95+
"typeCoverage": {
96+
"atLeast": 98
9297
}
9398
}

packages/eslint-mdx/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-mdx.svg)](https://travis-ci.com/rx-ts/eslint-mdx)
1414
[![Codecov](https://img.shields.io/codecov/c/gh/rx-ts/eslint-mdx)](https://codecov.io/gh/rx-ts/eslint-mdx)
15+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/rx-ts/eslint-mdx)
1516
[![GitHub release](https://img.shields.io/github/release/rx-ts/eslint-mdx)](https://github.com/rx-ts/eslint-mdx/releases)
1617
[![David Dev](https://img.shields.io/david/dev/rx-ts/eslint-mdx.svg)](https://david-dm.org/rx-ts/eslint-mdx?type=dev)
1718
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
1819
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1920
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org)
21+
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io)
2022

2123
> [ESLint] Parser/Plugin for [MDX], helps you lint all ES syntaxes excluding `code` block of course.
2224
> Work perfectly with `eslint-plugin-import`, `eslint-plugin-prettier` or any other eslint plugins.

packages/eslint-mdx/src/traverse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Traverser, TraverseOptions } from './types'
1111
import { Node, Parent } from 'unist'
1212

1313
export class Traverse {
14+
// @internal
1415
private readonly _enter: Traverser
1516

1617
constructor({ enter }: TraverseOptions) {

packages/eslint-plugin-mdx/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-mdx.svg)](https://travis-ci.com/rx-ts/eslint-mdx)
1414
[![Codecov](https://img.shields.io/codecov/c/gh/rx-ts/eslint-mdx)](https://codecov.io/gh/rx-ts/eslint-mdx)
15+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/rx-ts/eslint-mdx)
1516
[![GitHub release](https://img.shields.io/github/release/rx-ts/eslint-mdx)](https://github.com/rx-ts/eslint-mdx/releases)
1617
[![David Dev](https://img.shields.io/david/dev/rx-ts/eslint-mdx.svg)](https://david-dm.org/rx-ts/eslint-mdx?type=dev)
1718
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
1819
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1920
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org)
21+
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io)
2022

2123
> [ESLint] Parser/Plugin for [MDX], helps you lint all ES syntaxes excluding `code` block of course.
2224
> Work perfectly with `eslint-plugin-import`, `eslint-plugin-prettier` or any other eslint plugins.

tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "tsconfig-1stg",
2+
"extends": "./node_modules/tsconfig-1stg/tsconfig.json",
33
"compilerOptions": {
44
"module": "commonjs",
55
"outDir": "lib",

yarn.lock

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,7 +4074,7 @@ glob-to-regexp@^0.3.0:
40744074
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
40754075
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
40764076

4077-
glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
4077+
glob@7, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
40784078
version "7.1.4"
40794079
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
40804080
integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==
@@ -5885,7 +5885,7 @@ mimic-fn@^2.0.0, mimic-fn@^2.1.0:
58855885
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
58865886
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
58875887

5888-
minimatch@^3.0.4:
5888+
minimatch@3, minimatch@^3.0.4:
58895889
version "3.0.4"
58905890
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
58915891
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
@@ -5905,7 +5905,7 @@ [email protected]:
59055905
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
59065906
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
59075907

5908-
minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
5908+
minimist@1.2.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
59095909
version "1.2.0"
59105910
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
59115911
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
@@ -8206,6 +8206,14 @@ ts-jest@^24.0.2:
82068206
semver "^5.5"
82078207
yargs-parser "10.x"
82088208

8209+
ts-lib-utils@^2.2.0:
8210+
version "2.2.0"
8211+
resolved "https://registry.yarnpkg.com/ts-lib-utils/-/ts-lib-utils-2.2.0.tgz#dbf198ba67e2fee027f36bd2f9c0cbd638ed1731"
8212+
integrity sha512-yfZWuQs5bfQA2RLJdHUOSL2+Iw4NcZ8eKglVVW25aXi3sdLEoJxHB3tC2CN+x4MY4X39tcFCGlE5V7IF8O3m8w==
8213+
dependencies:
8214+
glob "7"
8215+
tslib "1"
8216+
82098217
ts-node@^8.3.0:
82108218
version "8.3.0"
82118219
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.3.0.tgz#e4059618411371924a1fb5f3b125915f324efb57"
@@ -8233,11 +8241,18 @@ tsconfig-paths@^3.6.0:
82338241
minimist "^1.2.0"
82348242
strip-bom "^3.0.0"
82358243

8236-
tslib@^1.8.1, tslib@^1.9.0:
8244+
tslib@1, tslib@^1.8.1, tslib@^1.9.0:
82378245
version "1.10.0"
82388246
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
82398247
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
82408248

8249+
tsutils@3:
8250+
version "3.17.1"
8251+
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
8252+
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
8253+
dependencies:
8254+
tslib "^1.8.1"
8255+
82418256
tsutils@^3.14.0:
82428257
version "3.17.0"
82438258
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.0.tgz#c3ccab927a475aa2beef6a3695c2ff76da13cdf8"
@@ -8264,6 +8279,24 @@ type-check@~0.3.2:
82648279
dependencies:
82658280
prelude-ls "~1.1.2"
82668281

8282+
type-coverage-core@^2.2.0:
8283+
version "2.2.0"
8284+
resolved "https://registry.yarnpkg.com/type-coverage-core/-/type-coverage-core-2.2.0.tgz#436ebe4f1b7bfd36ab019c840147fbcbb4bd4f1f"
8285+
integrity sha512-b7NTFy8HSo57C0zvJK5Vy8K+KWmQEyCFvXE7E8I6VXtt6clHuDg8z4L+CfnSGtt1ZovDu2C6+qjmBgdTZHeJyw==
8286+
dependencies:
8287+
minimatch "3"
8288+
ts-lib-utils "^2.2.0"
8289+
tslib "1"
8290+
tsutils "3"
8291+
8292+
type-coverage@^2.2.0:
8293+
version "2.2.0"
8294+
resolved "https://registry.yarnpkg.com/type-coverage/-/type-coverage-2.2.0.tgz#b588fd88d322b3b81a1b85bb6a9431c092d6dbb4"
8295+
integrity sha512-nU0aRXcSmpkg+T9XZrdpMY967O9YY9VUvE5siyvoHf+4B0oVRpCZACKfKC4AjLFSe4pIwvBqAlo6xKbk9+rDMw==
8296+
dependencies:
8297+
minimist "1.2.0"
8298+
type-coverage-core "^2.2.0"
8299+
82678300
type-fest@^0.3.0:
82688301
version "0.3.1"
82698302
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1"

0 commit comments

Comments
 (0)