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

Switch to ts recommended-type-checked #149

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions .changeset/eight-panthers-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@neuledge/eslint-config': major
'@neuledge/eslint-config-next': major
---

Switch to ts recommended-type-checked
16 changes: 16 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"mode": "pre",
"tag": "type-check",
"initialVersions": {
"@neuledge/env": "1.0.0",
"@neuledge/eslint-config": "1.3.0",
"@neuledge/eslint-config-next": "1.1.1",
"@neuledge/id": "1.2.0",
"@neuledge/jest-ts-preset": "1.0.1",
"@neuledge/jest-tsd-preset": "1.0.2",
"@neuledge/process": "1.1.2",
"@neuledge/tsconfig": "3.2.0",
"@neuledge/units": "1.0.0"
},
"changesets": []
}
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: '@neuledge',

parserOptions: {
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
tsconfigRootDir: __dirname,
},
};
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions packages/eslint-config-next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ pnpm add -D eslint husky lint-staged prettier @neuledge/eslint-config-next
```json
{
"extends": "@neuledge/next",
"parserOptions": {
"project": ["./tsconfig.json"]
},

"settings": {
"next": {
Expand Down
5 changes: 4 additions & 1 deletion packages/eslint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ pnpm add -D eslint husky lint-staged prettier @neuledge/eslint-config

```json
{
"extends": "@neuledge"
"extends": "@neuledge",
"parserOptions": {
"project": ["./tsconfig.eslint.json", "./packages/*/tsconfig.json"]
}
}
```

Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:unicorn/recommended',

// Make sure this is always the last configuration in the extends array:
Expand Down Expand Up @@ -81,6 +81,7 @@ module.exports = {
],
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'unicorn/explicit-length-check': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prevent-abbreviations': 'off',
Expand Down
16 changes: 13 additions & 3 deletions packages/process/src/service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/no-process-exit */
import { awaitTimeout, MINUTE_MS, SECOND_MS } from '@neuledge/units';
import {
printError,
Expand Down Expand Up @@ -154,19 +155,28 @@ export const initService = async (
const exitHandler = (): void => {
printLog(`exit signal catch`);

terminate();
terminate().catch((error) => {
printError(`Error on terminate`, error);
process.exit(1);
});
};

process.on('unhandledRejection', (err) => {
printError(`Unhandled Rejection`, err);

terminate();
terminate().catch((error) => {
printError(`Error on terminate`, error);
process.exit(1);
});
});

process.on('uncaughtException', (err) => {
printError(`Unhandled Exception`, err);

terminate();
terminate().catch((error) => {
printError(`Error on terminate`, error);
process.exit(1);
});
});

process.on('SIGTERM', exitHandler);
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@neuledge/tsconfig/base.json",
"include": ["**/.*.cjs", "**/*.cjs", "**/*.mjs", "**/*.js", "**/*.jsx"]
}
8 changes: 6 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
"dependsOn": ["^test", "build", "types"],
"inputs": ["src/**", "test/**"]
},
"lint": {},
"lint:strict": {},
"lint": {
"dependsOn": ["^types"]
},
"lint:strict": {
"dependsOn": ["^types"]
},
"deploy": {
"dependsOn": ["test", "lint:strict"]
}
Expand Down
Loading