Skip to content

Commit

Permalink
feat: eslint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Sep 27, 2023
1 parent d088411 commit 6457b1a
Show file tree
Hide file tree
Showing 93 changed files with 1,921 additions and 1,324 deletions.
44 changes: 44 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import rubiin from "@rubiin/eslint-config";

export default rubiin({
stylistic: true, // enable stylistic rules
typescript: {
tsconfigPath: "tsconfig.json", // path to tsconfig.json
},
},
{
rules: {
"unicorn/prefer-module": "off",
"ts/no-floating-promises": "off",
"ts/no-extraneous-class": "off",
"ts/unbound-method": "off",
"no-useless-constructor": "off", // optimize this
"ts/require-await": "off", // optimize this
"ts/no-unsafe-assignment": "off", // optimize this
"ts/no-unsafe-member-access": "off", // optimize this
"unicorn/prefer-top-level-await": "off",
"max-nested-callbacks": "off", // rxjs is nested
"ts/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],
"unicorn/prevent-abbreviations": [
"error",
{
ignore: [
"\\.e2e*",
"\\.spec*",
"\\.decorator*",
"\\*idx*",
],
allowList: {
ProcessEnv: true,
UUIDParam: true,
},
},
],
},
},
);
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
],
"scripts": {
"build": "nest build",
"lint": "eslint '{src,test}/**/*.ts' --cache",
"lint:fix": "eslint '{src,test}/**/*.ts' --cache --fix",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs '{src,test}/**/*.ts' --cache",
"lint:fix": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs '{src,test}/**/*.ts' --cache --fix --debug",
"orm": "npx mikro-orm",
"prebuild": "rimraf dist",
"sample": "cd env; npx sample-env --env .env.dev",
Expand All @@ -52,7 +52,7 @@
"test:e2e": "jest --config ./test/jest-e2e.json --runInBand --forceExit"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.418.0",
"@aws-sdk/client-s3": "^3.420.0",
"@aws-sdk/client-ses": "^3.418.0",
"@casl/ability": "^6.5.0",
"@golevelup/nestjs-rabbitmq": "^4.0.0",
Expand Down Expand Up @@ -82,8 +82,8 @@
"@nestjs/websockets": "^10.2.6",
"@ntegral/nestjs-sentry": "^4.0.0",
"@paralleldrive/cuid2": "^2.2.2",
"@sentry/hub": "^7.71.0",
"@sentry/node": "^7.71.0",
"@sentry/hub": "^7.72.0",
"@sentry/node": "^7.72.0",
"@socket.io/redis-adapter": "^8.2.1",
"@supercharge/request-ip": "^1.2.0",
"argon2": "^0.31.1",
Expand Down Expand Up @@ -146,9 +146,10 @@
"@nestjs/cli": "10.1.18",
"@nestjs/schematics": "10.0.2",
"@nestjs/testing": "10.2.6",
"@rubiin/eslint-config": "^1.8.1",
"@rubiin/eslint-config-ts": "^1.5.1",
"@rubiin/tsconfig": "^1.1.0",
"@sentry/types": "^7.71.0",
"@sentry/types": "^7.72.0",
"@side/jest-runtime": "^1.1.0",
"@swc/core": "^1.3.89",
"@swc/jest": "^0.2.29",
Expand All @@ -172,13 +173,10 @@
"@types/supertest": "2.0.13",
"@types/swagger-stats": "^0.95.9",
"@types/swagger-ui-express": "^4.1.4",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "3.3.0",
"eslint": "^8.50.0",
"eslint-define-config": "^1.23.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint_d": "^12.2.1",
"husky": "^8.0.3",
"jest": "29.7.0",
Expand Down
Loading

0 comments on commit 6457b1a

Please sign in to comment.