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 26, 2023
1 parent b2227bd commit 3887e24
Show file tree
Hide file tree
Showing 93 changed files with 1,877 additions and 1,281 deletions.
46 changes: 46 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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",
"style/quotes": "off",
"style/semi-style": ["error", "last"],
"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,
},
},
],
},
},
);
8 changes: 3 additions & 5 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 Down Expand Up @@ -146,6 +146,7 @@
"@nestjs/cli": "10.1.18",
"@nestjs/schematics": "10.0.2",
"@nestjs/testing": "10.2.6",
"@rubiin/eslint-config": "^1.8.0",
"@rubiin/eslint-config-ts": "^1.5.1",
"@rubiin/tsconfig": "^1.1.0",
"@sentry/types": "^7.71.0",
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 3887e24

Please sign in to comment.