Skip to content

Commit

Permalink
chore: migrate to @typescript-eslint from tslint (#287)
Browse files Browse the repository at this point in the history
* chore: use ESLint

* chore: fix lint problems

* chore: remove tslint

* chore: add `lint` and `fix` script

* chore: fix CI for linting
  • Loading branch information
sosukesuzuki authored Sep 30, 2022
1 parent c58490f commit 1b2a40a
Show file tree
Hide file tree
Showing 6 changed files with 932 additions and 109 deletions.
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"env": { "node": true },
"rules": {
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-constant-condition": ["error", { "checkLoops": false }]
}
}
7 changes: 5 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ jobs:
- name: Install Dependencies
run: yarn

- name: Run Lint
run: yarn lint
- name: Run ESLint
run: yarn lint:eslint

- name: Run Prettier
run: yarn lint:prettier
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
"license": "MIT",
"scripts": {
"prepublish": "patch-package && yarn run build",
"lint": "tslint -p ./tsconfig.json",
"lint": "run-p lint:*",
"lint:eslint": "eslint --ext=.ts .",
"lint:prettier": "prettier --check src",
"fix": "run-s fix:*",
"fix:eslint": "yarn lint:eslint --fix",
"fix:prettier": "yarn lint:prettier --write",
"test": "jest",
"prebuild": "rm -rf ./lib",
"build": "tsc -p ./tsconfig.build.json",
Expand All @@ -32,15 +37,17 @@
"devDependencies": {
"@types/jest": "29.1.0",
"@types/node": "18.7.23",
"@typescript-eslint/eslint-plugin": "5.38.1",
"@typescript-eslint/parser": "5.38.1",
"eslint": "8.24.0",
"eslint-config-prettier": "^8.5.0",
"jest": "29.1.1",
"jest-snapshot-serializer-raw": "1.2.0",
"npm-run-all": "^4.1.5",
"patch-package": "6.4.7",
"prettier": "2.7.1",
"standard-version": "9.5.0",
"ts-jest": "29.0.2",
"tslint": "6.1.3",
"tslint-config-prettier": "1.18.0",
"tslint-plugin-prettier": "2.3.0",
"typescript": "4.8.4"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function stringifyNode(
.concat("trailingComment" in node ? "trailingComment" : [])
.concat("endComments" in node ? "endComments" : [])
.map(key =>
// @ts-ignore
// @ts-expect-error why?
([].concat(node[key]).filter(Boolean) as Comment[]).map(
comment =>
`<${key.replace(/s$/, "")} value=${JSON.stringify(
Expand Down
17 changes: 0 additions & 17 deletions tslint.json

This file was deleted.

Loading

0 comments on commit 1b2a40a

Please sign in to comment.