diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8396fa1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }] +} diff --git a/packages/typescript-babel/README.md b/packages/typescript-babel/README.md index c20d495..5132e53 100644 --- a/packages/typescript-babel/README.md +++ b/packages/typescript-babel/README.md @@ -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`. diff --git a/packages/typescript-babel/eslint.config.mjs b/packages/typescript-babel/eslint.config.mjs new file mode 100644 index 0000000..354500e --- /dev/null +++ b/packages/typescript-babel/eslint.config.mjs @@ -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, +); diff --git a/packages/typescript-babel/package.json b/packages/typescript-babel/package.json index 7c07c7a..5e631a7 100644 --- a/packages/typescript-babel/package.json +++ b/packages/typescript-babel/package.json @@ -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" @@ -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" diff --git a/packages/typescript-babel/tslint.json b/packages/typescript-babel/tslint.json deleted file mode 100644 index f7bb7a7..0000000 --- a/packages/typescript-babel/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tslint:recommended" -} diff --git a/packages/typescript/README.md b/packages/typescript/README.md index dd7857e..c56f3f3 100644 --- a/packages/typescript/README.md +++ b/packages/typescript/README.md @@ -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 diff --git a/packages/typescript/eslint.config.mjs b/packages/typescript/eslint.config.mjs new file mode 100644 index 0000000..7281018 --- /dev/null +++ b/packages/typescript/eslint.config.mjs @@ -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, +); diff --git a/packages/typescript/package.json b/packages/typescript/package.json index bffc8f8..3c15efe 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -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" }, @@ -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" diff --git a/packages/typescript/tslint.json b/packages/typescript/tslint.json deleted file mode 100644 index f7bb7a7..0000000 --- a/packages/typescript/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tslint:recommended" -}