Skip to content

Commit

Permalink
Aligned ESLint and TS values and fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
JimTheCactus committed Oct 14, 2024
1 parent 963ae59 commit 5b7cb99
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 135 deletions.
30 changes: 22 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ import prettierConfig from "eslint-config-prettier";
import jestEslint from "eslint-plugin-jest";

export default tseslint.config(
{
ignores: [
".yarn/",
".yarn/*",
".husky/",
".husky/*",
"**/dist/**",
"**/node_modules/**",
],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
{
Expand All @@ -29,6 +39,7 @@ export default tseslint.config(
parser: tseslint.parser,
parserOptions: {
project: "tsconfig.eslint.json",
//projectService: true,
},
},
plugins: {
Expand Down Expand Up @@ -64,14 +75,6 @@ export default tseslint.config(
],
},
},
{
files: ["eslint.config.mjs"],
rules: {
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
},
},
// And specific rules for test code
{
files: ["**/*.test.ts"],
Expand All @@ -82,11 +85,22 @@ export default tseslint.config(
},
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"jest/no-disabled-tests": "off",
},
},
// Rules specifically for the configuration file
{
files: ["eslint.config.mjs"],
rules: {
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
},
},
// Disable rules that conflict with prettier
prettierConfig,
);
36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,46 @@
"license": "Apache-2.0",
"version": "0.2.0",
"devDependencies": {
"@eslint/js": "^9.10.0",
"@eslint/js": "^9.12.0",
"@tsconfig/node20": "^20.1.4",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/jest": "^29.5.13",
"@types/node": "^20.16.5",
"@types/source-map-support": "^0",
"@types/supertest": "^6.0.2",
"@types/wait-on": "^5.3.4",
"axios": "^1.7.7",
"axios-mock-adapter": "^1.22.0",
"concurrently": "^8.2.2",
"eslint": "^9.2.0",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.5.0",
"husky": "^9.0.11",
"eslint-plugin-jest": "^28.8.3",
"husky": "^9.1.6",
"jest": "^29.7.0",
"jest-extended": "^4.0.2",
"jest-junit": "^16.0.0",
"lint-staged": "^15.2.2",
"node-mocks-http": "^1.14.1",
"nodemon": "^3.1.0",
"lint-staged": "^15.2.10",
"node-mocks-http": "^1.16.1",
"nodemon": "^3.1.7",
"pinst": "^3.0.0",
"prettier": "^3.2.5",
"prettier": "^3.3.3",
"supertest": "^7.0.0",
"ts-jest": "^29.1.2",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.8.0",
"typescript": "~5.5.4",
"typescript-eslint": "^8.8.1",
"wait-on": "^8.0.1"
},
"dependencies": {
"date-fns": "^4.1.0",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"openapi-backend": "^5.10.6",
"pino": "^8.8.0",
"pino-http": "^8.5.1",
"express": "^4.21.1",
"openapi-backend": "^5.11.0",
"pino": "^8.21.0",
"pino-http": "^8.6.1",
"source-map-support": "^0.5.21"
},
"scripts": {
Expand All @@ -50,7 +52,7 @@
"start": "node ./dist/src/index.js",
"dev": "ts-node ./src/index.ts",
"watch": "nodemon src/index.ts",
"lint": "eslint --max-warnings=0 ./src ./eslint.config.mjs ./jest.config.ts",
"lint": "eslint --max-warnings=0",
"clean": "tsc --build --clean",
"fmt": "prettier --write .",
"fmt-chk": "prettier --check .",
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"src/**/*.ts",
"src/**/*.js",
"package.json",
"eslint.config.mjs",
"jest.config.ts"
]
Expand Down
Loading

0 comments on commit 5b7cb99

Please sign in to comment.