Skip to content

Commit

Permalink
fix: align ESLint rules with Prettier to resolve formatting conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mhd-hi committed Apr 4, 2024
1 parent 6890b92 commit 8b87f35
Show file tree
Hide file tree
Showing 5 changed files with 6,669 additions and 6,624 deletions.
89 changes: 44 additions & 45 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', "import", "simple-import-sort"],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'airbnb-typescript/base'
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
"@typescript-eslint/lines-between-class-members": "off",
"complexity": ["warn", { "max": 10 }],
"complexity": ["error", { "max": 15 }],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
overrides: {
constructors: 'no-public',
},
},
],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
'prettier/prettier': [
'error',
{
endOfLine: 'lf',
},
],
"indent": "off",
"@typescript-eslint/indent": "error"
},

};
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'import', 'simple-import-sort'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'airbnb-typescript/base',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', 'dist/'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
complexity: ['warn', { max: 10 }],
complexity: ['error', { max: 15 }],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
overrides: {
constructors: 'no-public',
},
},
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'prettier/prettier': [
'error',
{
endOfLine: 'lf',
},
],
indent: 'off',
'@typescript-eslint/indent': 'off',
},
};
9 changes: 6 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all"
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
"editor.formatOnSave": true,
"[typescript]": {
"editor.tabSize": 2,
"editor.formatOnSave": true
},
"[javascript]": {
"editor.tabSize": 2,
"editor.formatOnSave": true
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.eol": "\n"
}
182 changes: 91 additions & 91 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
{
"name": "planif-ets-backend",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "prisma generate && nest build",
"start": "nest start",
"dev": "nest start --watch",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint .",
"refresh": "rm -rf dist && rm -rf node_modules && yarn cache clean && yarn install",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"commonjs\"} prisma/seed.ts"
},
"dependencies": {
"@nestjs/axios": "^3.0.1",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.1",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@prisma/client": "^5.7.1",
"axios": "^1.6.8",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"pdf2json": "^3.0.5",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"uuid": "^9.0.1"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@swc/cli": "^0.1.65",
"@swc/core": "^1.4.8",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.2",
"@types/multer": "^1.4.11",
"@types/node": "^20.3.1",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.0.0",
"jest": "^29.5.0",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"prisma": "^5.7.1",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3",
"typescript-eslint": "^7.1.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
{
"name": "planif-ets-backend",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "prisma generate && nest build",
"start": "nest start",
"dev": "nest start --watch",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint .",
"refresh": "rm -rf dist && rm -rf node_modules && yarn cache clean && yarn install",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"commonjs\"} prisma/seed.ts"
},
"dependencies": {
"@nestjs/axios": "^3.0.1",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.1",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@prisma/client": "^5.7.1",
"axios": "^1.6.8",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"pdf2json": "^3.0.5",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"uuid": "^9.0.1"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@swc/cli": "^0.1.65",
"@swc/core": "^1.4.8",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.2",
"@types/multer": "^1.4.11",
"@types/node": "^20.3.1",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.0.0",
"jest": "^29.5.0",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"prisma": "^5.7.1",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3",
"typescript-eslint": "^7.1.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
Loading

0 comments on commit 8b87f35

Please sign in to comment.