Skip to content

Commit

Permalink
Update ESLint configuration, adjusted rules, updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
eduwardo committed Jan 31, 2025
1 parent 600bef1 commit c73b25b
Show file tree
Hide file tree
Showing 49 changed files with 777 additions and 728 deletions.
82 changes: 44 additions & 38 deletions packages/clients/eservice-operations/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,53 @@ import tsPlugin from "@typescript-eslint/eslint-plugin";
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
import globals from "globals";

export default [
{
ignores: ["eslint.config.js", "vitest.config.ts", "**/dist"],
{
ignores: [
"eslint.config.js",
"vitest.config.ts",
"**/dist",
"node_modules",
],
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
globals: globals.node,
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
globals: {
process: "readonly",
__dirname: "readonly",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
...prettierPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
...prettierPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,

"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
"eqeqeq": ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/await-thenable": "off",
"no-redeclare": "off",
},
"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
eqeqeq: ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/await-thenable": "off",
"no-redeclare": "off",
"no-console": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"max-classes-per-file": ["error", 1],
},
},
];
7 changes: 4 additions & 3 deletions packages/clients/eservice-operations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "8.21.0",
"@typescript-eslint/parser": "8.21.0",
"ts-node": "10.9.2",
"typescript": "5.2.2",
"eslint": "9.19.0",
"eslint-config-prettier": "10.0.1",
"eslint-plugin-prettier": "5.2.3",
"prettier": "3.2.5"
"globals": "^15.14.0",
"prettier": "3.2.5",
"ts-node": "10.9.2",
"typescript": "5.2.2"
},
"dependencies": {
"@zodios/core": "10.9.6",
Expand Down
92 changes: 44 additions & 48 deletions packages/commons/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,53 @@ import tsPlugin from "@typescript-eslint/eslint-plugin";
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
import globals from "globals";

export default [
{
ignores: ["eslint.config.js", "vitest.config.ts", "**/dist", "node_modules"],
{
ignores: [
"eslint.config.js",
"vitest.config.ts",
"**/dist",
"node_modules",
],
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
globals: globals.node,
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
globals: {
process: "readonly",
__dirname: "readonly",
console: "readonly",
setTimeout: "readonly",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
...prettierPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
...prettierPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,

"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
"eqeqeq": ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/await-thenable": "off",
"no-redeclare": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"no-console": "off",
"no-undef": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-constant-condition": "off",
},
"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
eqeqeq: ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/await-thenable": "off",
"no-redeclare": "off",
"no-console": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"max-classes-per-file": ["error", 1],
},
},
];
1 change: 1 addition & 0 deletions packages/commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"eslint": "9.19.0",
"eslint-config-prettier": "10.0.1",
"eslint-plugin-prettier": "5.2.3",
"globals": "^15.14.0",
"prettier": "3.2.5",
"typescript": "5.2.2"
}
Expand Down
1 change: 0 additions & 1 deletion packages/commons/src/logging/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import winston from "winston";
import { LoggerConfig } from "../config/loggerConfig.js";

Expand Down
1 change: 0 additions & 1 deletion packages/commons/src/logging/loggerMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as express from "express";
import { AppContext } from "../context/context.js";
import { LoggerMetadata, logger } from "./index.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/src/sqs/sqs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-constant-condition */
import {
SQSClient,
ReceiveMessageCommand,
Expand All @@ -14,6 +13,7 @@ import { ConsumerConfig } from "../config/consumerConfig.js";
const serializeError = (error: unknown): string => {
try {
return JSON.stringify(error, Object.getOwnPropertyNames(error));
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
return `${error}`;
}
Expand Down
82 changes: 44 additions & 38 deletions packages/eservice-event-consumer/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,53 @@ import tsPlugin from "@typescript-eslint/eslint-plugin";
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
import globals from "globals";

export default [
{
ignores: ["eslint.config.js", "vitest.config.ts", "**/dist"],
{
ignores: [
"eslint.config.js",
"vitest.config.ts",
"**/dist",
"node_modules",
],
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
globals: globals.node,
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
globals: {
process: "readonly",
__dirname: "readonly",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
...prettierPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...prettier.rules,
...prettierPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,

"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
"eqeqeq": ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/await-thenable": "off",
"no-redeclare": "off",
},
"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
eqeqeq: ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/await-thenable": "off",
"no-redeclare": "off",
"no-console": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"max-classes-per-file": ["error", 1],
},
},
];
3 changes: 2 additions & 1 deletion packages/eservice-event-consumer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"kafka-connector": "workspace:*",
"kafkajs": "2.2.4",
"pagopa-interop-probing-commons": "workspace:*",
"pagopa-interop-probing-models": "workspace:*",
"pagopa-interop-probing-eservice-operations-client": "workspace:*",
"pagopa-interop-probing-models": "workspace:*",
"ts-pattern": "5.0.6",
"uuid": "10.0.0",
"zod": "3.23.8"
Expand All @@ -41,6 +41,7 @@
"eslint": "9.19.0",
"eslint-config-prettier": "10.0.1",
"eslint-plugin-prettier": "5.2.3",
"globals": "^15.14.0",
"prettier": "3.2.5",
"ts-node": "10.9.2",
"typescript": "5.2.2",
Expand Down
Loading

0 comments on commit c73b25b

Please sign in to comment.