Skip to content

Commit

Permalink
Remove tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nschulzke committed Mar 20, 2023
1 parent 6efb0e9 commit 9085552
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 197 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Run checks
run: |
./dist/index.js tsc tsconfig.json
./dist/index.js tslint tsconfig.json
./dist/index.js eslint .
report-typescript-checks:
runs-on: ubuntu-latest
Expand All @@ -41,7 +40,6 @@ jobs:
- name: Run and report checks
run: |
./dist/index.js tsc tsconfig.json --repo ${{ github.repository }}
./dist/index.js tslint tsconfig.json --repo ${{ github.repository }}
./dist/index.js eslint tsconfig.json --repo ${{ github.repository }}
env:
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# typescript-checks

Get Typescript and TSLint diagnostics and post results as a GitHub Check.
Get Typescript and ESLint diagnostics and post results as a GitHub Check.

## Prerequisites

- [Set up a GitHub App](https://developer.github.com/apps/quickstart-guides/setting-up-your-development-environment) that requests `checks:write` permissions.
- Install the app for the repo where you want to run TS / TSLint checks.
- Install the app for the repo where you want to run TS / ESLint checks.

## Usage

Expand All @@ -15,7 +15,6 @@ typescript-checks [command]
Commands:
index.ts tsc <tsconfig> Check TypeScript errors
index.ts tslint <tsconfig> Check TSLint errors
index.ts eslint <directory> Check ESLint errors
Options:
Expand All @@ -27,7 +26,7 @@ Options:
--label A label for this check run [string]
This tool gets TypeScript, TSLint, or ESLint diagnostics and posts results as a
This tool gets TypeScript or ESLint diagnostics and posts results as a
"check run" to the given GitHub repository.
The following environment variables, corresponding to a GitHub app with
Expand Down
26 changes: 5 additions & 21 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
// tslint:disable:no-var-requires
// eslint-disable @typescript-eslint/no-var-requires
require("ts-node/register/transpile-only");
import * as path from "path";
require("dotenv").config({
Expand All @@ -8,10 +8,9 @@ require("dotenv").config({
import { createAppAuth } from "@octokit/auth-app";
import { Octokit } from "@octokit/rest";
import { eslintCheck } from "./eslint";
import { tslintCheck } from "./tslint";
import { typescriptCheck } from "./typescript";

const TSLINT_CHECK_APP_ID = 42099;
const TYPESCRIPT_CHECK_APP_ID = 42099;

export type GithubInfo = {
/**
Expand All @@ -33,11 +32,11 @@ import yargs from "yargs";
import { getGitRepositoryDirectoryForFile, getGitSHA } from "./git-helpers";
import { GithubCheckAnnotation } from "./octokit-types";

// tslint:disable-next-line: no-unused-expression
// eslint-disable-next-line no-unused-expressions
yargs
.epilogue(
`
This tool gets TypeScript, TSLint, or ESLint diagnostics and posts results as a "check run" to the given GitHub repository.
This tool gets TypeScript or ESLint diagnostics and posts results as a "check run" to the given GitHub repository.
The following environment variables, corresponding to a GitHub app with 'checks:write' permission, are used to authenticate with the GitHub API:
Expand Down Expand Up @@ -76,21 +75,6 @@ They can also be provided in a ".env" file in the current working directory.`
});
}
)
.command(
"tslint <tsconfig>",
"Check TSLint errors",
builder =>
builder.positional("tsconfig", {
describe: "Path to the TypeScript project configuration file",
type: "string",
default: path.join(process.cwd(), "tsconfig.json")
}),
argv =>
runCheck("TSLint", () => tslintCheck({ tsConfigFile: argv.tsconfig }), {
...argv,
location: argv.tsconfig
})
)
.command(
"eslint <directory>",
"Check ESLint errors",
Expand Down Expand Up @@ -208,7 +192,7 @@ async function runCheck(

async function authenticate(): Promise<Octokit> {
const auth = createAppAuth({
id: TSLINT_CHECK_APP_ID,
id: TYPESCRIPT_CHECK_APP_ID,
privateKey: process.env.GITHUB_APP_PRIVATE_KEY || "",
installationId: Number(process.env.GITHUB_APP_INSTALLATION_ID),
clientId: process.env.GITHUB_APP_CLIENT_ID,
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
"*.{ts,js,css,md}": "prettier --write",
"*.{ts,tsx,js}": ["yarn build", "yarn eslint", "yarn tslint"]
"*.{ts,tsx,js}": ["yarn build", "yarn eslint"]
};
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
],
"scripts": {
"typecheck": "./dist/index.js tsc tsconfig.json",
"tslint": "./dist/index.js tslint tsconfig.json",
"eslint": "./dist/index.js eslint tsconfig.json",
"build": "tsc -p tsconfig.json && chmod +x dist/index.js",
"watch": "tsc -w -p tsconfig.json",
Expand All @@ -29,7 +28,6 @@
},
"peerDependencies": {
"eslint": "^7.26.0",
"tslint": "^5.19.0",
"typescript": "^4.1.3"
},
"devDependencies": {
Expand All @@ -42,7 +40,6 @@
"lint-staged": "^11.0.0",
"prettier": "^1.18.2",
"ts-node": "^8.4.1",
"tslint": "^5.19.0",
"typescript": "^4.1.3"
}
}
16 changes: 0 additions & 16 deletions tslint.json

This file was deleted.

66 changes: 0 additions & 66 deletions tslint.ts

This file was deleted.

88 changes: 4 additions & 84 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -429,17 +429,12 @@ buffer-from@^1.0.0:
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==

builtin-modules@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=

callsites@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==

chalk@^2.0.0, chalk@^2.3.0:
chalk@^2.0.0:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -509,11 +504,6 @@ color-name@~1.1.4:
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==

commander@^2.12.1:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

commander@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
Expand Down Expand Up @@ -825,11 +815,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=

function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==

functional-red-black-tree@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
Expand Down Expand Up @@ -857,7 +842,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0:
dependencies:
is-glob "^4.0.1"

glob@^7.1.1, glob@^7.1.3:
glob@^7.1.3:
version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
Expand Down Expand Up @@ -905,13 +890,6 @@ has-flag@^4.0.0:
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==

has@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
dependencies:
function-bind "^1.1.1"

human-signals@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
Expand Down Expand Up @@ -968,13 +946,6 @@ is-arrayish@^0.2.1:
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=

is-core-module@^2.2.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1"
integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==
dependencies:
has "^1.0.3"

is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
Expand Down Expand Up @@ -1252,18 +1223,6 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

mkdirp@^0.5.1:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
dependencies:
minimist "^1.2.5"

[email protected]:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
Expand Down Expand Up @@ -1356,11 +1315,6 @@ path-key@^3.0.0, path-key@^3.1.0:
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==

path-parse@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==

path-type@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
Expand Down Expand Up @@ -1423,14 +1377,6 @@ resolve-from@^4.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==

resolve@^1.3.2:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
dependencies:
is-core-module "^2.2.0"
path-parse "^1.0.6"

restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
Expand Down Expand Up @@ -1475,7 +1421,7 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=

semver@^5.3.0, semver@^5.6.0:
semver@^5.6.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
Expand Down Expand Up @@ -1639,37 +1585,11 @@ ts-node@^8.4.1:
source-map-support "^0.5.17"
yn "3.1.1"

tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
tslib@^1.8.1, tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslint@^5.19.0:
version "5.20.1"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d"
integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==
dependencies:
"@babel/code-frame" "^7.0.0"
builtin-modules "^1.1.1"
chalk "^2.3.0"
commander "^2.12.1"
diff "^4.0.1"
glob "^7.1.1"
js-yaml "^3.13.1"
minimatch "^3.0.4"
mkdirp "^0.5.1"
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.8.0"
tsutils "^2.29.0"

tsutils@^2.29.0:
version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
dependencies:
tslib "^1.8.1"

tsutils@^3.17.1:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
Expand Down

0 comments on commit 9085552

Please sign in to comment.