Skip to content

Commit

Permalink
fix(various): Upgrade eslint to use typescript-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
vanthome committed Oct 23, 2024
1 parent 8a9ce59 commit b580f00
Show file tree
Hide file tree
Showing 59 changed files with 918 additions and 5,963 deletions.
5,953 changes: 593 additions & 5,360 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"license": "MIT",
"homepage": "https://github.com/restorecommerce/libs#readme",
"devDependencies": {
"typescript": "^5.6.2",
"typescript-eslint": "8.10.0",
"cz-conventional-changelog": "^3.3.0",
"@eslint/js": "9.13.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "9.13.0",
"eslint-plugin-prefer-arrow-functions": "^3.4.1",
"lerna": "^8.1.8",
"nx": "20.0.3",
"tar": "^7.4.3"
"tar": "^7.4.3",
"typescript": "^5.6.2",
"typescript-eslint": "^8.11.0"
},
"workspaces": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/acs-client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ npm-debug.log
.nyc_output
.idea

lib/*/**
lib/*
*.js.map
*.js
*.d.ts
Expand Down
5 changes: 3 additions & 2 deletions packages/acs-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@
"winston": "^3.14.2"
},
"devDependencies": {
"@restorecommerce/dev": "^0.0.12",
"@alenon/grpc-mock-server": "^3.1.15",
"@eslint/js": "^9.12.0",
"@restorecommerce/protos": "^6.8.11",
"@types/eslint__js": "^8.42.3",
"@types/koa": "^2.15.0",
"@types/mocha": "^10.0.9",
"@types/node": "^22.7.5",
"@types/node": "^22.7.9",
"@types/redis": "^4.0.2",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
Expand All @@ -51,7 +52,7 @@
"should": "^13.2.3",
"ts-node": "^10.9.1",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.1"
"typescript-eslint": "8.11.0"
},
"scripts": {
"build:tsc": "tsc -d",
Expand Down
2 changes: 1 addition & 1 deletion packages/acs-client/src/acs/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const DefaultMetaDataInjector = async <T extends ResourceList>(
return request;
};

export function access_controlled_service<T extends { new(...args: any): }>(baseService: T): any {
export function access_controlled_service<T extends { new(...args: any) }>(baseService: T): any {
return class extends baseService implements AccessControlledService {
public readonly __userService: Client<UserServiceDefinition>;
public readonly __acsDatabaseProvider: DatabaseProvider;
Expand Down
14 changes: 14 additions & 0 deletions packages/acs-client/tsconfig-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../node_modules/@restorecommerce/dev/tsconfig.json",
"compilerOptions": {
"outDir": "./lib",
"types": ["node", "jest"],
"resolveJsonModule": true
},
"exclude": [
"node_modules",
"lib",
"doc"
]
}

28 changes: 1 addition & 27 deletions packages/acs-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
{
"compilerOptions": {
"target": "ES2023",
"module": "ESNext",
"moduleResolution": "node",
"declaration": true,
// "strict": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"noUnusedLocals": false,
"skipLibCheck": true,
"esModuleInterop": true,
"sourceMap": true,
"outDir": "lib",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2020.promise",
"dom"
]
},
"extends": "./tsconfig-base.json",
"include": [
"./src/**/*.ts"
],
"exclude": [
"node_modules",
"lib",
"doc"
]
}
9 changes: 2 additions & 7 deletions packages/acs-client/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "test"
},
"types": [
"@types/jest"
],
"include": [
"test/**/*.ts"
"./src/**/*.ts",
"./tests/**/*.ts"
]
}
76 changes: 0 additions & 76 deletions packages/cart/.eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/cart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"store": "^2.0.12"
},
"devDependencies": {
"@restorecommerce/dev": "^0.0.12",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.4",
"@types/should": "^13.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cluster-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"coveralls": "^3.1.1",
"is-generator": "^1.0.3",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"nyc": "17.1.0",
"should": "^13.2.3"
},
"scripts": {
Expand Down
10 changes: 3 additions & 7 deletions packages/dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@
],
"type": "module",
"dependencies": {
"@eslint/compat": "^1.0.3",
"@typescript-eslint/eslint-plugin": "8.10.0",
"@typescript-eslint/parser": "8.10.0",
"eslint-plugin-file-extension-in-import-ts": "^2.1.0",
"eslint-plugin-prefer-arrow-functions": "^3.3.2",
"eslint-plugin-unicorn": "56.0.0",
"typescript-eslint": "8.10.0"
"eslint": "^9.12.0",
"eslint-plugin-prefer-arrow-functions": "^3.4.1",
"typescript-eslint": "8.11.0"
},
"peerDependencies": {
"@types/node": ">=18.15.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"sourceMap": true,
"strict": true,
"strictNullChecks": false,
"target": "ES2022"
"target": "ES2023"
},
"ts-node": {
"experimentalResolver": true,
Expand Down
81 changes: 0 additions & 81 deletions packages/gql-bot/.eslintrc.js

This file was deleted.

22 changes: 22 additions & 0 deletions packages/gql-bot/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @ts-check

import eslint from '@eslint/js';
import { RuleTester } from 'eslint';
import tseslint from 'typescript-eslint';

const rules = tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
);

rules.push(
{
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"prefer-rest-params": "off",
}
}
);

export default rules;
Loading

0 comments on commit b580f00

Please sign in to comment.