Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate from TSLint to ESLint #97

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading