Skip to content

Commit

Permalink
chore: migrate from TSLint to ESLint (#97)
Browse files Browse the repository at this point in the history
* chore: migrate from TSLint to ESLint

* chore: remove unnecessary package-lock.json files

* add missing stylistic

* chore: finish, finally
  • Loading branch information
JoshuaKGoldberg authored Jan 2, 2025
1 parent ec08b35 commit 16a5f6b
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }]
}
2 changes: 1 addition & 1 deletion packages/typescript-babel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a example that uses Babel to transform TypeScript to plain JavaScript, a
## Commands

- `npm run check-types` - check types for TypeScript.
- `npm run lint` - run the TypeScript linter using the `tslint.json` config file.
- `npm run lint` - run ESLint with typescript-eslint
- `npm run compile` - compile the ES6 TypeScript into the `/lib` directory.
- `npm test` - run the tests using the local `.mocharc.json` config file. Babel Config set is inside `babel.config.js`.

Expand Down
9 changes: 9 additions & 0 deletions packages/typescript-babel/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["lib", "test/babel-register.js", "*.config.js"] },
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
);
8 changes: 5 additions & 3 deletions packages/typescript-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "lib/index.d.ts",
"scripts": {
"check-types": "tsc",
"lint": "tslint --project tsconfig.json",
"lint": "eslint .",
"compile": "babel src -d lib --extensions '.ts,.tsx'",
"prepublish": "npm run check-types && npm run compile",
"test": "mocha"
Expand All @@ -22,11 +22,13 @@
"@babel/preset-env": "^7.4.1",
"@babel/preset-typescript": "^7.3.3",
"@babel/register": "^7.6.2",
"@eslint/js": "^9.12.0",
"@types/mocha": "latest",
"assert": "^2.0.0",
"eslint": "^9.12.0",
"mocha": "latest",
"tslint": "^6.1.3",
"typescript": "^4.2.4"
"typescript": "^4.9.5",
"typescript-eslint": "^8.8.1"
},
"engines": {
"node": ">=10.0.0"
Expand Down
3 changes: 0 additions & 3 deletions packages/typescript-babel/tslint.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tests here are kept next to their code (not in a separate dir). This was done to
## Commands

- `npm run compile` - compile the ES6 Typescript into the `/lib` directory
- `npm run lint` - run the Typescript linter using the `tslint.json` config file.
- `npm run lint` - run ESLint with typescript-eslint
- `npm test` - run the tests using the local `.mocharc.json` config file. As the config includes the Typescript transpilation hook `ts-node/register` it does not require pre-compilation before running.

## ES Modules
Expand Down
9 changes: 9 additions & 0 deletions packages/typescript/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["lib"] },
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
);
8 changes: 5 additions & 3 deletions packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "lib/index.d.ts",
"scripts": {
"compile": "tsc --declaration",
"lint": "tslint --project tsconfig.json",
"lint": "eslint .",
"prepublish": "npm run compile",
"test": "mocha"
},
Expand All @@ -16,12 +16,14 @@
"test": "./src"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@types/mocha": "latest",
"assert": "^2.0.0",
"eslint": "^9.12.0",
"mocha": "latest",
"ts-node": "^9.1.1",
"tslint": "^6.1.3",
"typescript": "^4.2.4"
"typescript": "^4.9.5",
"typescript-eslint": "^8.8.1"
},
"engines": {
"node": ">=10.0.0"
Expand Down
3 changes: 0 additions & 3 deletions packages/typescript/tslint.json

This file was deleted.

0 comments on commit 16a5f6b

Please sign in to comment.